From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0002.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0001.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0003.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0002.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0004.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0003.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0005.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0005.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment.html From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0006.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0006.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0001.html From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0007.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0007.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0002.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0008.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0008.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0003.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0009.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0009.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0005.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0010.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0010.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0006.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0011.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0011.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0007.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0012.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0012.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0008.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0013.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0013.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0009.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0001.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment.html From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0014.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0014.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0010.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0002.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0001.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0015.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0015.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0011.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0003.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0002.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0001.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0016.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0016.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0012.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0005.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0004.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0003.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0017.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0017.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0013.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0006.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0005.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0004.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0018.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0018.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0014.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0007.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0006.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0005.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0002.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0002.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0019.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0019.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0015.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0008.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0007.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0006.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0003.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0003.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0001.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0020.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0020.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0016.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0009.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0008.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0007.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0004.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0004.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0002.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0021.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0021.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0017.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0010.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0009.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0008.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0005.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0005.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0003.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0001.html From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0022.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0022.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0018.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0011.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0010.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0009.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0006.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0006.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0005.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0002.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0023.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0023.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0019.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0012.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0011.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0010.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0007.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0007.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0006.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0003.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0001.html From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0024.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0024.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0020.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0013.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0012.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0011.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0008.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0008.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0007.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0004.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0002.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0001.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0025.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0025.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0021.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0014.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0013.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0012.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0009.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0009.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0008.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0005.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0003.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0002.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0002.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0002.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0026.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0026.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0022.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0015.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0014.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0013.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0010.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0010.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0009.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0006.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0004.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0003.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0003.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0003.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0027.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0027.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0023.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0016.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0015.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0014.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0011.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0011.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0010.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0007.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0005.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0004.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0004.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0004.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0002.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment.html From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0028.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0028.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0024.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0017.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0016.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0015.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0012.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0012.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0011.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0008.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0006.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0005.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0005.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0005.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0003.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0001.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0029.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0029.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0025.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0018.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0017.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0016.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0013.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0013.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0012.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0009.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0007.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0006.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0006.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0006.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0004.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0002.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0030.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0030.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0026.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0019.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0018.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0017.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0014.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0014.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0013.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0010.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0008.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0007.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0007.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0007.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0005.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0003.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0001.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment.html From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0031.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0031.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0027.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0020.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0019.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0018.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0015.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0015.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0014.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0011.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0009.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0008.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0008.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0008.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0006.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0005.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0002.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0002.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0001.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0032.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0032.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0028.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0021.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0020.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0019.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0016.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0016.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0015.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0012.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0010.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0009.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0009.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0009.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0007.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0006.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0003.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0003.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0002.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0033.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0033.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0029.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0022.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0021.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0020.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0017.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0017.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0016.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0013.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0011.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0010.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0010.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0010.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0008.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0007.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0004.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0004.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0003.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0034.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0034.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0030.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0023.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0022.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0021.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0018.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0018.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0017.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0014.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0012.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0011.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0011.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0011.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0009.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0008.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0005.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0005.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0004.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0035.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0035.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0031.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0024.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0023.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0022.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0019.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0019.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0018.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0015.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0013.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0012.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0012.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0012.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0010.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0009.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0006.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0006.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0005.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0036.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0036.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0032.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0025.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0024.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0023.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0020.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0020.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0019.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0016.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0014.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0013.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0013.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0013.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0011.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0010.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0007.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0007.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0006.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0037.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0037.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0033.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0026.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0025.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0024.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0021.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0021.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0020.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0017.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0015.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0014.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0014.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0014.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0012.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0011.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0008.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0008.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0008.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0038.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0038.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0034.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0027.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0026.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0025.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0022.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0022.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0021.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0018.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0016.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0015.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0015.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0015.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0013.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0012.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0009.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0009.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0009.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0039.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0039.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0035.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0028.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0027.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0026.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0023.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0023.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0022.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0019.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0017.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0016.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0016.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0016.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0014.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0013.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0010.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0010.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0010.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0040.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0040.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0036.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0029.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0028.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0027.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0024.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0024.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0023.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0020.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0018.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0017.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0017.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0017.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0015.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0014.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0011.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0011.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0011.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0041.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0041.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0037.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0030.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0029.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0028.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0025.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0025.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0024.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0021.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0019.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0018.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0018.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0018.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0016.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0015.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0012.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0012.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0012.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0042.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0042.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0038.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0031.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0030.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0029.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0026.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0026.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0025.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0022.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0020.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0019.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0019.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0019.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0017.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0016.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0013.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0013.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0013.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0043.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0043.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0039.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0032.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0031.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0030.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0027.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0027.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0026.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0023.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0021.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0020.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0020.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0020.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0018.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0017.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0014.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0014.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0014.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0044.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0044.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0040.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0033.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0032.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0031.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0028.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0028.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0027.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0024.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0022.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0021.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0021.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0021.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0019.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0018.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0015.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0015.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0015.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0045.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0045.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0041.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0034.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0033.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0032.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0029.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0029.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0028.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0025.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0023.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0022.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0022.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0022.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0020.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0019.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0016.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0016.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0016.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0046.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0046.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0042.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0035.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0034.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0033.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0030.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0030.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0029.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0026.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0024.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0023.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0023.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0023.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0021.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0020.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0017.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0017.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0017.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0047.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0047.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0043.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0036.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0035.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0034.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0031.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0031.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0030.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0027.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0025.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0024.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0024.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0024.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0022.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0021.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0018.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0018.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0018.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0048.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0048.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0044.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0037.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0036.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0035.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0032.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0032.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0031.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0028.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0026.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0025.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0025.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0025.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0023.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0022.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0019.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0019.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0019.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0049.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0049.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little difficult to get code (not an application of mine). I only know >> what is written and what is receaved (no Xon/Xoff char) >> >> Python (use library "pyserial" ; same result as C++): >> #-- 9600/N/8/1/XonXoff >> mySerial = serial.Serial( \ >> port = 0, \ >> baudrate = 9600, \ >> bytesize = 8, \ >> parity = 'N', \ >> stopbits = 1, \ >> timeout = 20, \ >> xonxoff = 1, \ >> rtscts = 0) >> bPortOpen = mySerial.isOpen() >> >> #-- Send N data to the Printer >> mySerial.write(sDataOut) >> ... >> >> #-- Read printing result >> sDataIn = mySerial.read(10) >> >> #--> sDataIn: "#15#31#30#32#32" (no Xoff) >> >> Thanks in advance >> Best regards. >> >> Cyrille. >> >> >> Trent Jarvi a ?crit : >> >>> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >>> >>> >>>> Hi All, >>>> >>>> I'm using, for a project, a thermal printer (UBI501 : >>>> 9600/N/8/1/XonXoff) in order to print stickers. >>>> When I print a sticker, the printing result is available on the com >>>> port. >>>> >>>> When I use C++ to read on the com port, I've, for ex., >>>> "#15#31#30#32#32" >>>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>>> I've "#13#15#31#30#32#32" >>>> (# : hexa) >>>> >>>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>>> printing result. >>>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>>> XonXoff flow ctrl is activated? >>>> (I never find them with C++) >>>> A way to deal with them ? >>>> >>>> Thanks in advance. >>>> Best regards >>>> >>>> Cyrille. >>>> >>>> >>> Hi Crylle: >>> >>> Sounds like we are doing something wrong. >>> >>> What OS are you using? >>> What is the java code in a simple test case? >>> What is the corresponding C++ code? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Fri Jul 4 03:26:49 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Jul 2008 05:26:49 -0400 Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: Hi All, My max DTR speed (with a frequency meter, mac osx and a Keyspan 19HS) is 100 HZ. serialPortInterface.setSerialPortParams( 19200, SerialPortInterface.DATABITS_8, SerialPortInterface.STOPBITS_1, SerialPortInterface.PARITY_ODD); System.out.println("Baud is " + serialPortInterface.getBaudRate()); System.out.println("Bits is " + serialPortInterface.getDataBits()); System.out.println("Stop is " + serialPortInterface.getStopBits()); System.out.println("Par is " + serialPortInterface.getParity()); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); for (int i = 0; i < 10000000; i++) { final float i1 = .0001f; //ThreadUtils.sleep(i1); serialPortInterface.setRTS(false); serialPortInterface.setDTR(false); //System.out.println("set dtr:" + i + " times."); //ThreadUtils.sleep(i1); serialPortInterface.setDTR(true); serialPortInterface.setRTS(true); } Reports a much faster loop rate than is actually output, electrically. This is also confirmed by the visible flicker shown on the break-out box. I did not hook this up to an o-scope. I was not able to get the RTS line to assert false, despite the appearance of the code. Are people getting different results on different computers? I did try different baud rates (1200, 2400, etc). Thanks! - Doug From tjarvi at qbang.org Fri Jul 4 11:12:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 11:12:48 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Hi Doug. 100 HZ... thats about 10 ms as mentioned earlier. My understanding is that the fundamental problem you face is that servicing serial devices (like mice) faster than that can significantly impact an OS with GUIs. Nobody wants to see their browser stall when they whip their mouse left and right. There was a less formal talk about this very thing at the Linux Symposium that called it the wiggle test as I recall. Schedualing in Linux was a hot area at the time. If you are trying to generate a square wave with a serial port, you may try sending "UUUUUUUU" at various baud rates with 8n1. As I recall, that genertates a square wave on the tx.. It would be fun to send that to a stepper motor... -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Fri Jul 4 19:11:22 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 4 Jul 2008 21:11:22 -0400 Subject: [Rxtx] Javax.comm and gnu.io Message-ID: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Hi, Currently there are two branches: javax.comm and gnu.io. The latter is the maintained branch of RxTx. Other than the name space, what is functionally different between the two? Would there anything be preventing us from simply creating an adapter to gnu.io, for the people who need to depend on the javax.comm? Andre From tjarvi at qbang.org Fri Jul 4 20:34:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 4 Jul 2008 20:34:47 -0600 (MDT) Subject: [Rxtx] Javax.comm and gnu.io In-Reply-To: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: On Fri, 4 Jul 2008, Andre-John Mas wrote: > Hi, > > Currently there are two branches: javax.comm and gnu.io. The latter is > the maintained branch of RxTx. Other than the name space, what is > functionally different between the two? Would there anything be > preventing us from simply creating an adapter to gnu.io, for the > people who need to depend on the javax.comm? > Presuming the adaptor would still plug into Sun's commapi 2.0, we could do that. In the past, we just copied the 2.1 code base and made the adaptor. other than taking precautions to not extend Sun's API with the rxtx extensions (marked as such), I don't see any issues. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 4 22:57:26 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 5 Jul 2008 14:57:26 +1000 Subject: [Rxtx] custom serial mouse driver? Message-ID: <001d01c8de5b$aa0602d0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080705/f5ee480d/attachment-0045.html From tjarvi at qbang.org Sun Jul 6 22:01:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 6 Jul 2008 22:01:08 -0600 (MDT) Subject: [Rxtx] max dtr speed In-Reply-To: References: Message-ID: On Fri, 4 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > My max DTR speed (with a frequency meter, > mac osx and a Keyspan 19HS) is 100 HZ. > serialPortInterface.setSerialPortParams( > 19200, > SerialPortInterface.DATABITS_8, > SerialPortInterface.STOPBITS_1, > SerialPortInterface.PARITY_ODD); > System.out.println("Baud is " + serialPortInterface.getBaudRate()); > System.out.println("Bits is " + serialPortInterface.getDataBits()); > System.out.println("Stop is " + serialPortInterface.getStopBits()); > System.out.println("Par is " + serialPortInterface.getParity()); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_OUT); > > serialPortInterface.setFlowControlMode(SerialPortInterface.FLOWCONTROL_RTSCTS_IN); > for (int i = 0; i < 10000000; i++) { > final float i1 = .0001f; > //ThreadUtils.sleep(i1); > > > serialPortInterface.setRTS(false); > serialPortInterface.setDTR(false); > //System.out.println("set dtr:" + i + " times."); > //ThreadUtils.sleep(i1); > serialPortInterface.setDTR(true); > serialPortInterface.setRTS(true); > } > > Reports a much faster loop rate than is actually output, > electrically. This is also confirmed by the visible flicker shown > on the break-out box. I did not hook this up to an o-scope. > > I was not able to get the RTS line to assert false, despite the > appearance of the code. > > Are people getting different results on different computers? > I did try different baud rates (1200, 2400, etc). > Closing the loop... Doug found that RTS worked if flow control was disabled. -- Trent Jarvi tjarvi at qbang.org From Aaron.Lau at Kardium.com Mon Jul 7 18:05:56 2008 From: Aaron.Lau at Kardium.com (Aaron Lau) Date: Mon, 7 Jul 2008 17:05:56 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION Message-ID: Hi Trent and others, I've been using RxTx in a Java app for talking to a FPGA board through a USB-Serial converter. However, at some random time the Java virtual machine would crash and complains about the dll being problematic. Apologies if I'm not looking/posting at the right place, but I've been browsing around for several days but found no relevant or similar info nor a solution to it. It seems like that RxTx sometimes crashes if you close() the port while some other thread is trying to read(). Of course it is inappropriate to do a read() AFTER close() occurs, but it is legitimate for a close() to happen DURING a read() call (at least throw an IOException than crashing), correct? I wrote some codes trying to reproduce the crash, but I couldn't get the crash to happen consistently either. I've been trying to isolate the problem but failed to find a conclusion. There're several questions that I have in mind right now. Does RxTx supports Windows Vista? This crash happens on both mine and another desktop, both of which runs Vista. Maybe the dll I got is corrupted? I've been using the binaries from http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried compiling RxTx myself though. Below is the environment I'm running the apps on. Platform: 32-bit Windows Vista Ultimate (SP1) CPU: Intel Core2 Duo 2.66GHz RAM: 2GB Java: Java JDK 1.6.0_05 IDE: IntelliJ IDEA 7.0.2 Attached below is one of the error logs I got. Thanks, Aaron _________________________________ # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, tid=4100 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x9e69] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 Registers: EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 EIP=0x04049e69, EFLAGS=0x00010206 Top of Stack: (sp=0x0412f6f0) 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 0x0412f720: 00000007 00000000 00000001 00000001 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 0x0412f750: 01e59f39 00000004 0412f758 00000000 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 Instructions: (pc=0x04049e69) 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x9e69] C [rxtxSerial.dll+0xa05e] J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J gnu.io.RXTXPort.readByte()I J gnu.io.RXTXPort$SerialInputStream.read()I v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, stack(0x04470000,0x044c0000)] =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, stack(0x040e0000,0x04130000)] 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=5436, stack(0x03fe0000,0x04030000)] 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4736, stack(0x03f40000,0x03f90000)] 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5020, stack(0x03ef0000,0x03f40000)] 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, id=4932, stack(0x03ea0000,0x03ef0000)] 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2900, stack(0x03e50000,0x03ea0000)] 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, stack(0x00ea0000,0x00ef0000)] 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2472, stack(0x00e50000,0x00ea0000)] 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, stack(0x00380000,0x003d0000)] Other Threads: 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 128K [0x24020000, 0x24120000, 0x24500000) eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) tenured generation total 4096K, used 100K [0x24500000, 0x24900000, 0x28020000) the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, 0x24900000) compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, 0x2c020000) the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, 0x28c20000) ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, 0x2c820000) rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, 0x2d420000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_05\bin\java.exe 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll 0x6d870000 - 0x6dac0000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll 0x10000000 - 0x10011000 C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll 0x75340000 - 0x754de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll 0x6d320000 - 0x6d328000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\hpi.dll 0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\verify.dll 0x6d3c0000 - 0x6d3df000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\java.dll 0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\zip.dll 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin\breakgen.dll 0x6d620000 - 0x6d633000 C:\Program Files\Java\jdk1.6.0_05\jre\bin\net.dll 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll 0x04040000 - 0x04052000 C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial .dll 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll VM Arguments: jvm_args: -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 java_command: com.intellij.rt.execution.application.AppMain RxTxTester Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Program Files\Perforce\;C:\Lint USERNAME=alau OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel --------------- S Y S T E M --------------- OS: Windows Vista Build 6001 Service Pack 1 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Fri Jul 04 16:58:25 2008 elapsed time: 191 seconds From johnny.luong at trustcommerce.com Mon Jul 7 19:19:20 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 07 Jul 2008 18:19:20 -0700 Subject: [Rxtx] dll crashes in JVM: EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <4872C098.6080300@trustcommerce.com> Hi Aaron, I actually encountered something like that as well and what I ended up doing was pulling RXTX from CVS (it has a few fixes that I thought were important) and it seemed to go away on both Windows 2000 / XP boxes -- I actually filed a bug report in bugzilla with a very similar fault. So you might want to try building the source from CVS and see if its resolved there. Best, Johnny Aaron Lau wrote: > Hi Trent and others, > > I've been using RxTx in a Java app for talking to a FPGA board through a > USB-Serial converter. However, at some random time the Java virtual > machine would crash and complains about the dll being problematic. > Apologies if I'm not looking/posting at the right place, but I've been > browsing around for several days but found no relevant or similar info > nor a solution to it. > > It seems like that RxTx sometimes crashes if you close() the port while > some other thread is trying to read(). Of course it is inappropriate to > do a read() AFTER close() occurs, but it is legitimate for a close() to > happen DURING a read() call (at least throw an IOException than > crashing), correct? I wrote some codes trying to reproduce the crash, > but I couldn't get the crash to happen consistently either. > > I've been trying to isolate the problem but failed to find a conclusion. > There're several questions that I have in mind right now. > > Does RxTx supports Windows Vista? This crash happens on both mine and > another desktop, both of which runs Vista. > Maybe the dll I got is corrupted? I've been using the binaries from > http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, havn't tried > compiling RxTx myself though. > > Below is the environment I'm running the apps on. > > Platform: 32-bit Windows Vista Ultimate (SP1) > CPU: Intel Core2 Duo 2.66GHz > RAM: 2GB > Java: Java JDK 1.6.0_05 > IDE: IntelliJ IDEA 7.0.2 > > Attached below is one of the error logs I got. > > Thanks, > > > Aaron > > _________________________________ > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04049e69, pid=5692, > tid=4100 > # > # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x9e69] > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # The crash happened outside the Java Virtual Machine in native code. > # See problematic frame for where to report the bug. > # > > --------------- T H R E A D --------------- > > Current thread (0x01dd9c00): JavaThread "Thread-1" [_thread_in_native, > id=4100, stack(0x040e0000,0x04130000)] > > siginfo: ExceptionCode=0xc0000005, writing address 0x040af770 > > Registers: > EAX=0x040af768, EBX=0x00000000, ECX=0x0000000f, EDX=0x00000000 > ESP=0x0412f6f0, EBP=0x0412f8d8, ESI=0x241142a8, EDI=0x01dd9c00 > EIP=0x04049e69, EFLAGS=0x00010206 > > Top of Stack: (sp=0x0412f6f0) > 0x0412f6f0: 00000000 6da7e348 01dd9cf4 0412f794 > 0x0412f700: 0412f6f4 000023ac 00000000 0412d704 > 0x0412f710: 0412f738 6d3c20ba 01dd9cf4 040af768 > 0x0412f720: 00000007 00000000 00000001 00000001 > 0x0412f730: 2c053770 2c86d398 0412f778 01e59c91 > 0x0412f740: 00dd9cf4 0412f794 0412f790 0412d704 > 0x0412f750: 01e59f39 00000004 0412f758 00000000 > 0x0412f760: 0412f794 2c86cc60 00000000 2c86d398 > > Instructions: (pc=0x04049e69) > 0x04049e59: 00 83 c4 10 8b 85 44 fe ff ff 8b 95 4c fe ff ff > 0x04049e69: 89 50 08 b8 ff ff ff ff eb 5d 90 8b 85 44 fe ff > > > Stack: [0x040e0000,0x04130000], sp=0x0412f6f0, free space=317k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > C [rxtxSerial.dll+0x9e69] > C [rxtxSerial.dll+0xa05e] > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) > J gnu.io.RXTXPort.readByte()I > J gnu.io.RXTXPort$SerialInputStream.read()I > v ~BufferBlob::Interpreter > v ~BufferBlob::Interpreter > v ~BufferBlob::StubRoutines (1) > > --------------- P R O C E S S --------------- > > Java Threads: ( => current thread ) > 0x01dda400 JavaThread "WriterThread" [_thread_blocked, id=4996, > stack(0x04470000,0x044c0000)] > =>0x01dd9c00 JavaThread "ReaderThread" [_thread_in_native, id=4100, > stack(0x040e0000,0x04130000)] > 0x01dca000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, > id=5436, stack(0x03fe0000,0x04030000)] > 0x01da4400 JavaThread "Low Memory Detector" daemon [_thread_blocked, > id=4736, stack(0x03f40000,0x03f90000)] > 0x01d94800 JavaThread "CompilerThread0" daemon [_thread_blocked, > id=5020, stack(0x03ef0000,0x03f40000)] > 0x01d94000 JavaThread "Attach Listener" daemon [_thread_blocked, > id=4932, stack(0x03ea0000,0x03ef0000)] > 0x01d8b800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, > id=2900, stack(0x03e50000,0x03ea0000)] > 0x01d87400 JavaThread "Finalizer" daemon [_thread_blocked, id=4568, > stack(0x00ea0000,0x00ef0000)] > 0x01d83000 JavaThread "Reference Handler" daemon [_thread_blocked, > id=2472, stack(0x00e50000,0x00ea0000)] > 0x00f37800 JavaThread "main" [_thread_in_native, id=2244, > stack(0x00380000,0x003d0000)] > > Other Threads: > 0x01d82000 VMThread [stack: 0x00e00000,0x00e50000] [id=4144] > 0x01dbd000 WatcherThread [stack: 0x03f90000,0x03fe0000] [id=2252] > > VM state:not at safepoint (normal execution) > > VM Mutex/Monitor currently owned by a thread: None > > Heap > def new generation total 960K, used 128K [0x24020000, 0x24120000, > 0x24500000) > eden space 896K, 7% used [0x24020000, 0x240302b0, 0x24100000) > from space 64K, 100% used [0x24110000, 0x24120000, 0x24120000) > to space 64K, 0% used [0x24100000, 0x24100000, 0x24110000) > tenured generation total 4096K, used 100K [0x24500000, 0x24900000, > 0x28020000) > the space 4096K, 2% used [0x24500000, 0x24519248, 0x24519400, > 0x24900000) > compacting perm gen total 12288K, used 144K [0x28020000, 0x28c20000, > 0x2c020000) > the space 12288K, 1% used [0x28020000, 0x280442b8, 0x28044400, > 0x28c20000) > ro space 8192K, 66% used [0x2c020000, 0x2c570dc8, 0x2c570e00, > 0x2c820000) > rw space 12288K, 52% used [0x2c820000, 0x2ce704b0, 0x2ce70600, > 0x2d420000) > > Dynamic libraries: > 0x00400000 - 0x00423000 C:\Program > Files\Java\jdk1.6.0_05\bin\java.exe > 0x77030000 - 0x77157000 C:\Windows\system32\ntdll.dll > 0x75c30000 - 0x75d0b000 C:\Windows\system32\kernel32.dll > 0x75aa0000 - 0x75b66000 C:\Windows\system32\ADVAPI32.dll > 0x76c70000 - 0x76d33000 C:\Windows\system32\RPCRT4.dll > 0x7c340000 - 0x7c396000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\msvcr71.dll > 0x6d870000 - 0x6dac0000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\client\jvm.dll > 0x76af0000 - 0x76b8d000 C:\Windows\system32\USER32.dll > 0x76820000 - 0x7686b000 C:\Windows\system32\GDI32.dll > 0x74110000 - 0x74142000 C:\Windows\system32\WINMM.dll > 0x769c0000 - 0x76a6a000 C:\Windows\system32\msvcrt.dll > 0x76870000 - 0x769b4000 C:\Windows\system32\ole32.dll > 0x76fa0000 - 0x7702d000 C:\Windows\system32\OLEAUT32.dll > 0x740d0000 - 0x74109000 C:\Windows\system32\OLEACC.dll > 0x77170000 - 0x7718e000 C:\Windows\system32\IMM32.DLL > 0x76d40000 - 0x76e08000 C:\Windows\system32\MSCTF.dll > 0x75710000 - 0x7573c000 C:\Windows\system32\apphelp.dll > 0x77160000 - 0x77169000 C:\Windows\system32\LPK.DLL > 0x76a70000 - 0x76aed000 C:\Windows\system32\USP10.dll > 0x10000000 - 0x10011000 > C:\PROGRA~1\KASPER~1\KASPER~1.0\r3hook.dll > 0x758a0000 - 0x758a7000 C:\Windows\system32\PSAPI.DLL > 0x76b90000 - 0x76be8000 C:\Windows\system32\SHLWAPI.dll > 0x75340000 - 0x754de000 > C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df > _6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll > 0x6d320000 - 0x6d328000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\hpi.dll > 0x6d820000 - 0x6d82c000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\verify.dll > 0x6d3c0000 - 0x6d3df000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\java.dll > 0x6d860000 - 0x6d86f000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\zip.dll > 0x00270000 - 0x00277000 C:\Program Files\JetBrains\IntelliJ IDEA > 7.0.2\bin\breakgen.dll > 0x6d620000 - 0x6d633000 C:\Program > Files\Java\jdk1.6.0_05\jre\bin\net.dll > 0x75c00000 - 0x75c2d000 C:\Windows\system32\WS2_32.dll > 0x758b0000 - 0x758b6000 C:\Windows\system32\NSI.dll > 0x74d40000 - 0x74d7b000 C:\Windows\system32\mswsock.dll > 0x74ec0000 - 0x74ec5000 C:\Windows\System32\wship6.dll > 0x04040000 - 0x04052000 > C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial > .dll > 0x6d570000 - 0x6d597000 C:\Windows\system32\crtdll.dll > 0x74a00000 - 0x74a05000 C:\Windows\System32\wshtcpip.dll > > VM Arguments: > jvm_args: > -Djava.library.path=C:\proj\3rdParty\RxTx\rxtx-2.1-7-bins-r2\Windows\i36 > 8-mingw32 -Didea.launcher.port=7542 -Didea.launcher.bin.path=C:\Program > Files\JetBrains\IntelliJ IDEA 7.0.2\bin -Dfile.encoding=windows-1252 > java_command: com.intellij.rt.execution.application.AppMain RxTxTester > Launcher Type: SUN_STANDARD > > Environment Variables: > PATH=C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ > ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\in > stalled_nt\lib\pcnt.lib;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Program Files\Perforce\;C:\Lint > USERNAME=alau > OS=Windows_NT > PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel > > > > --------------- S Y S T E M --------------- > > OS: Windows Vista Build 6001 Service Pack 1 > > CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 > stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 > > Memory: 4k page, physical 2085328k(917832k free), swap 4194303k(2671692k > free) > > vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE > (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ > 7.1 > > time: Fri Jul 04 16:58:25 2008 > elapsed time: 191 seconds > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Wed Jul 9 08:09:32 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 9 Jul 2008 16:09:32 +0200 Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Hello Trent, I noticed today that there are some obsolete copies of the RXTX Eclipse Update Site around, which we had set up when we tried to mirror stuff, but they had never worked properly: http://users.frii.com/jarvi/rxtx/eclipse/site.xml http://www.rxtx.org/eclipse/ These two only work from a Web Browser, but the Eclipse Update Manager cannot use them. Therefore, I would recommend to get rid of them (they are not up to date any more anyways). As of today, the one and only valid RXTX for Eclipse Update Site is this one: http://rxtx.qbang.org/eclipse/ with the corresponding ZIP downloads here: http://rxtx.qbang.org/eclipse/downloads/ Could these two links be referenced on the main RXTX homepage? That is, when I go to http://www.rxtx.org and click the "Downloads" link, I'd like to see the Eclipse Downloads and Update site referenced there, for instance like this: * Binaries for use with Ecilpse [Downloads | Update Site] Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jul 9 19:50:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 9 Jul 2008 19:50:28 -0600 (MDT) Subject: [Rxtx] Obsolete copies of RXTX for Eclipse Update Site In-Reply-To: <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> References: <915FD7F8-B7E7-4043-8916-EF664455D795@sympatico.ca> <460801A4097E3D4CA04CC64EE648584806940E04@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 9 Jul 2008, Oberhuber, Martin wrote: > Hello Trent, > > I noticed today that there are some obsolete copies of the > RXTX Eclipse Update Site around, which we had set up when > we tried to mirror stuff, but they had never worked properly: > > http://users.frii.com/jarvi/rxtx/eclipse/site.xml > http://www.rxtx.org/eclipse/ > > These two only work from a Web Browser, but the Eclipse > Update Manager cannot use them. Therefore, I would > recommend to get rid of them (they are not up to date > any more anyways). > > As of today, the one and only valid RXTX for Eclipse > Update Site is this one: > > http://rxtx.qbang.org/eclipse/ > > with the corresponding ZIP downloads here: > > http://rxtx.qbang.org/eclipse/downloads/ > > Could these two links be referenced on the main RXTX homepage? > That is, when I go to http://www.rxtx.org and click the > "Downloads" link, I'd like to see the Eclipse Downloads > and Update site referenced there, for instance like this: > > * Binaries for use with Ecilpse [Downloads | Update Site] > Thanks Martin. Done. -- Trent Jarvi tjarvi at qbang.org From lewlinn at telstra.com Fri Jul 11 17:23:50 2008 From: lewlinn at telstra.com (Lew L) Date: Sat, 12 Jul 2008 09:23:50 +1000 Subject: [Rxtx] using rxtx to read serial (mouse) input device Message-ID: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> G'day All, I have an application where I want to use a ball mouse ( or parts thereof ) as an inexpensive positioning device either by logging the x,y screen/window cursor position or even better, counting the pulses and direction from the encoders within the mouse. The thing is I still want to have a mouse available separately for use of the program. So 2 mouses would be connected to the PC. 1 - built into a notebook or a ps2 mouse used as the normal mouse. 2 - the other plugged into a serial port, but used for the positioning device. Does anyone know of way to look at a standard ( if there is such a thing!) ball mouse as a serial device when plugged into a serial port and what the protocols etc may be to count x,y pulses + direction of travel? Another issue I guess is how to stop Windows from looking at the Serial Port mouse as another mouse? I guess I am suggesting a simple custom serial mouse driver ( in java ) using RxTx, if Windows can be convinced it is not another mouse conflicting. Hope someone can helps! Thanks Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080712/a7a470c7/attachment-0038.html From ajmas at sympatico.ca Fri Jul 11 22:33:45 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 12 Jul 2008 00:33:45 -0400 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: While I can't be of specific help, one place that might be worth looking is the Linux Kernel source. There may be a driver in there that illustrates what you want to do, at least in the context of communicating with the mouse. Andre On 11-Jul-08, at 19:23 , Lew L wrote: > > > G'day All, > > I have an application where I want to use a ball mouse ( or parts > thereof ) as an inexpensive positioning device either by logging the > x,y screen/window cursor position or even better, counting the > pulses and direction from the encoders within the mouse. > > The thing is I still want to have a mouse available separately for > use of the program. So 2 mouses would be connected to the PC. > 1 - built into a notebook or a ps2 mouse used as the normal mouse. > 2 - the other plugged into a serial port, but used for the > positioning device. > > Does anyone know of way to look at a standard ( if there is such a > thing!) ball mouse as a serial device when plugged into a serial > port and what the protocols etc may be to count x,y pulses + > direction of travel? > > Another issue I guess is how to stop Windows from looking at the > Serial Port mouse as another mouse? > > I guess I am suggesting a simple custom serial mouse driver ( in > java ) using RxTx, if Windows can be convinced it is not another > mouse conflicting. > > Hope someone can helps! > Thanks > Lew > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sat Jul 12 06:10:52 2008 From: jredman at ergotech.com (Jim Redman) Date: Sat, 12 Jul 2008 06:10:52 -0600 Subject: [Rxtx] using rxtx to read serial (mouse) input device In-Reply-To: References: <002001c8e3ad$2f095fd0$0100000a@ll35e1d2095fc2> Message-ID: <48789F4C.1090604@ergotech.com> My recollection is that a old serial ball mice just sent out a stream of XY positions and button status. However, if we're talking an optical mouse, it may be a different game, see for example, here: http://spritesmods.com/?art=mouseeye Jim Andre-John Mas wrote: > While I can't be of specific help, one place that might be worth > looking is the Linux Kernel source. There may be a driver in there > that illustrates what you want to do, at least in the context of > communicating with the mouse. > > Andre > > On 11-Jul-08, at 19:23 , Lew L wrote: > >> >> G'day All, >> >> I have an application where I want to use a ball mouse ( or parts >> thereof ) as an inexpensive positioning device either by logging the >> x,y screen/window cursor position or even better, counting the >> pulses and direction from the encoders within the mouse. >> >> The thing is I still want to have a mouse available separately for >> use of the program. So 2 mouses would be connected to the PC. >> 1 - built into a notebook or a ps2 mouse used as the normal mouse. >> 2 - the other plugged into a serial port, but used for the >> positioning device. >> >> Does anyone know of way to look at a standard ( if there is such a >> thing!) ball mouse as a serial device when plugged into a serial >> port and what the protocols etc may be to count x,y pulses + >> direction of travel? >> >> Another issue I guess is how to stop Windows from looking at the >> Serial Port mouse as another mouse? >> >> I guess I am suggesting a simple custom serial mouse driver ( in >> java ) using RxTx, if Windows can be convinced it is not another >> mouse conflicting. >> >> Hope someone can helps! >> Thanks >> Lew >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From iqzw2r602 at sneakemail.com Sun Jul 13 07:02:17 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Sun, 13 Jul 2008 23:02:17 +1000 Subject: [Rxtx] Webstart bundle Message-ID: <18756-78480@sneakemail.com> Hi all, I wonder if there has any progress been made in making a webstart jar file for rxtx, as I've read that there's someone working on it. I'm currently trying to make my app web startable. My app is using bluecove (a java library that lets you access the system's bluetooth stack) and rxtx as a fallback solution (bluetooth via serial port). Bluecove deals with the webstart problem quite elegantly: Since it's got all its native libraries bundled within it's .jar file, all you need to do is to add that .jar file to your project. And that's it. No magic in the jnlp file required. With rxtx I wasn't so lucky so far; I tried to wrap all the native libraries into signed jars, as the webstart docs recommend, but it seems I'm banging my head against the wall; webstart System.loadLibrary() doesn't seem to find my library although it finds and uses the library's jar file. However, to make a long story short, the questions are: Is there's a one-JAR-webstart-able solution out there for rxtx that is as easy to use as bluecove? If not, would people (Trent?) find something like that useful? [I'm considering having a go at it - and on success offering it for integration into rxtx] What do you think? Cheers, Uwe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/1dda7db7/attachment-0037.html From bschlining at gmail.com Sun Jul 13 12:23:01 2008 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 13 Jul 2008 11:23:01 -0700 Subject: [Rxtx] Webstart bundle In-Reply-To: <18756-78480@sneakemail.com> References: <18756-78480@sneakemail.com> Message-ID: I use RXTX in a web start app and it works great. The JNLP file has the following: -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080713/ace77d11/attachment-0036.html From rxtx at allenjb.me.uk Mon Jul 14 03:01:23 2008 From: rxtx at allenjb.me.uk (AllenJB) Date: Mon, 14 Jul 2008 10:01:23 +0100 Subject: [Rxtx] Closing Serial Ports on Windows Vista Message-ID: <487B15E3.3020309@allenjb.me.uk> Hi, Has anyone had issues closing ports on Windows Vista? The port seems to close and release fine on XP, but on Vista trying to use the port again reports like it's already in use. The code I'm currently using to close a port after use is: public void close() { try { inputStream.close(); outputStream.close(); } catch (IOException e) { LOG.error("Ignoring IO Exception", e); } serialPort.close(); } (where inputStream and OutputStream were originally obtained using serialPort.getInputStream() and serialPort.getOutputStream(). If you would like more information, please let me know. Thanks in advance, AllenJB From tjarvi at qbang.org Mon Jul 14 19:19:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 14 Jul 2008 19:19:25 -0600 (MDT) Subject: [Rxtx] Closing Serial Ports on Windows Vista In-Reply-To: <487B15E3.3020309@allenjb.me.uk> References: <487B15E3.3020309@allenjb.me.uk> Message-ID: On Mon, 14 Jul 2008, AllenJB wrote: > Hi, > > Has anyone had issues closing ports on Windows Vista? The port seems to > close and release fine on XP, but on Vista trying to use the port again > reports like it's already in use. > > The code I'm currently using to close a port after use is: > public void close() { > try { > inputStream.close(); > outputStream.close(); > } catch (IOException e) { > LOG.error("Ignoring IO Exception", e); > } > serialPort.close(); > } > > (where inputStream and OutputStream were originally obtained using > serialPort.getInputStream() and serialPort.getOutputStream(). > > If you would like more information, please let me know. > Hi Allen, Is this a real serial port or a USB dongle? (if the later check for updates to the driver). Are you comparing like machines? - same number of CPUs/cores? Are you using the same version of Java on each? -- Trent Jarvi tjarvi at qbang.org From bboyes at systronix.com Wed Jul 16 17:20:22 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Wed, 16 Jul 2008 17:20:22 -0600 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080716/d0c9c3a5/attachment-0033.html From tjarvi at qbang.org Wed Jul 16 19:12:14 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 16 Jul 2008 19:12:14 -0600 (MDT) Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: On Wed, 16 Jul 2008, Bruce Boyes wrote: > Hi > > So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB > Bluetooth adapter with their software 5.2.227.1. Ultimately we want the > PC app to control a robot with the remote Bluetooth adapter. > http://trackbot.systronix.com/bluetooth.html > > If I use realterm to open a virtual COM25 port it automatically connects > through the USB BT to a remote BT device (a Lemos Int LM-048). I can > open and close the port as many times as I want to and the connection > gets made and then disconnected as it should. So this tends to tell me > that the USB BT adapter is OK and the Blue Soleil drivers seem to be > working OK. RealTerm and the USB BT don't use RXTX as far as I know. > > On the remote BT device I have it connected to another PC with RealTerm > running. One of the BT adapters sends a CONNECT and DISCONNECT message > at the appropriate times and I can see those on the remote PC RealTerm > window. I can type data both ways. > > However, when I try to use my own simple Java App on the PC, with RXTX > to the virtual COM port, things fall apart. > > BTW the same app on a cabled serial connection works fine, for millions > of messages, with RXTX, so the problem doesn't appear to be in my serial > code, or the RXTX comm package but in the use of BT or BT in combination > with RXTX? That's what I can't yet figure out. > > My Java code uses code like this to open the UART: > > CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); > then > SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // > try-catch causes this to always fail! > then > in = serialPort.getInputStream(); // in a try-catch > > With a clean powerup of the remote BT (Lemos LM-048), my Java code can > open an input stream and write some data. But: > > 1) I see a CONNECT and then a DISCONNECT - but have no idea why the > DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere > 2) then another CONNECT?? Why? > 3) then my short app runs, sends some data to the COM port and it's > transmitted over BT > 4) then my app closes the serial port and terminates > > If I try to run my app again, it reports that it got an instance of the > UART (COM25, a virtual serial port from Bluetooth) but in fact there is > no BT connection made. How is this possible? > > I have to power cycle the Lemos LM-048 adapter in order to get my code > to run again. The adapter takes 45 seconds to power up! This also seems > strange. > > And finally, if I put the cpi.open() in a try-catch block like this: > ????? try { > ????????SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); > ????????} catch (Exception piue) { > ???????? ???????? System.out.println(portName + " exception: " + > piue.getMessage()); > ???????? ???????? piue.printStackTrace(); > ????????} > if (null == serialPort) { > ???????? System.out .println("Error! " + getClass().getName() > ????????+ " can't get Serial Port " + portName); > ????????System. exit(2); > ????????} else { > ???????? System.out .println(getClass().getName() + " got Serial Port " > + portName); > ????????} > > The Exception is never thrown, but the value of serialPort is null so I > see the message. If I take the open() out of the try-catch, serialPort > is not null. I'm baffled. > > Can anyone shed some light on this? > > I'm going to write a simpler test program using javaxcomm and see if it > acts differently, and then try it with RXTX as well as with a wired > connection for both javaxcomm and rxtx. > Hi Bruce, Finding a bluetooth that works well with RXTX on windows is a not very easy in my experience. One that does work is the lego mindstorm adaptor. I'd love to hear from others if there are other adaptors that work. If you have issues, please report them to the hardware vendor too. In our experience with USB serial adaptors, they had many problems early on but now work amazing well for the most part. RXTX exercises a large portion of the 'serial' api on all OSs. That means it pokes bits some driver makers may not think are needed for bluetooth. For instance, does hardware flow control make sense when you are beaming bits? What do you do when rxtx asks if the buffer is overflowing? What does the driver do when someone is toggling a pin? Getting the driver working for reading and writing is probably the initial goal for serial while thinking that everyone will go to USB HID at some point. When vendors see there is still interest in the serial, they tend to take a second look. -- Trent Jarvi tjarvi at qbang.org From iqzw2r602 at sneakemail.com Wed Jul 16 19:44:16 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 17 Jul 2008 11:44:16 +1000 Subject: [Rxtx] RXTX on Windows and Bluetooth SPP doesn't work as expected In-Reply-To: References: Message-ID: <4580-25152@sneakemail.com> I've worked quite a lot with bluetooth over serial connections for a while, using RXTX. And I saw many strange issues like the one you are reporting. My application is a server running on a PC that is controllable via a mobile phone, via Bluetooth. My first go was to use rxtx, and it worked rather well, but I experienced similar connect/disconnect issues like you do. I eventually switched to bluecove (www.bluecove.org, a J2SE implementation of the J2ME bluetooth API [JSR-82]) and found it worked much better, so I can recommend that wholehartedly if the other options I'm presenting won't help you: Otherwise, I'd recommend: a) Try using signalling (RTS/CTS DTR/DSR), that seems to get through to the other side, so you know when something's connected b) Try _different_ bluetooth dongles. I own 4 (!!) of them now, so I can test against the three major stacks on the market (Microsoft's winsock bluetooth, the WIDCOMM stack and blue soleil, the one that you've got) I found the stacks to be quite different; I also recommend to download the stacks directly from the driver vendor (especially WIDCOMM), as the device vendors usually have outdated versions. You'll also find more information about the different bluetooth stacks on www.bluecove.org, so even if you don't want to use bluetooth directly from java with bluecove, it's still worth reading. Hope that helps, Cheers, Uwe On Thu, Jul 17, 2008 at 11:12 AM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > On Wed, 16 Jul 2008, Bruce Boyes wrote: > > Hi >> >> So I'm using RXTX on windows XP SP2 and talking to a Blue Soleil USB >> Bluetooth adapter with their software 5.2.227.1. Ultimately we want the >> PC app to control a robot with the remote Bluetooth adapter. >> http://trackbot.systronix.com/bluetooth.html >> >> If I use realterm to open a virtual COM25 port it automatically connects >> through the USB BT to a remote BT device (a Lemos Int LM-048). I can >> open and close the port as many times as I want to and the connection >> gets made and then disconnected as it should. So this tends to tell me >> that the USB BT adapter is OK and the Blue Soleil drivers seem to be >> working OK. RealTerm and the USB BT don't use RXTX as far as I know. >> >> On the remote BT device I have it connected to another PC with RealTerm >> running. One of the BT adapters sends a CONNECT and DISCONNECT message >> at the appropriate times and I can see those on the remote PC RealTerm >> window. I can type data both ways. >> >> However, when I try to use my own simple Java App on the PC, with RXTX >> to the virtual COM port, things fall apart. >> >> BTW the same app on a cabled serial connection works fine, for millions >> of messages, with RXTX, so the problem doesn't appear to be in my serial >> code, or the RXTX comm package but in the use of BT or BT in combination >> with RXTX? That's what I can't yet figure out. >> >> My Java code uses code like this to open the UART: >> >> CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(portName); >> then >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); // >> try-catch causes this to always fail! >> then >> in = serialPort.getInputStream(); // in a try-catch >> >> With a clean powerup of the remote BT (Lemos LM-048), my Java code can >> open an input stream and write some data. But: >> >> 1) I see a CONNECT and then a DISCONNECT - but have no idea why the >> DISCONNECT happens. AFAIK my code isn't closing the COM port anywhere >> 2) then another CONNECT?? Why? >> 3) then my short app runs, sends some data to the COM port and it's >> transmitted over BT >> 4) then my app closes the serial port and terminates >> >> If I try to run my app again, it reports that it got an instance of the >> UART (COM25, a virtual serial port from Bluetooth) but in fact there is >> no BT connection made. How is this possible? >> >> I have to power cycle the Lemos LM-048 adapter in order to get my code >> to run again. The adapter takes 45 seconds to power up! This also seems >> strange. >> >> And finally, if I put the cpi.open() in a try-catch block like this: >> try { >> SerialPort serialPort = (SerialPort) cpi.open("TrackBot", 5000); >> } catch (Exception piue) { >> System.out.println(portName + " exception: " + >> piue.getMessage()); >> piue.printStackTrace(); >> } >> if (null == serialPort) { >> System.out .println("Error! " + getClass().getName() >> + " can't get Serial Port " + portName); >> System. exit(2); >> } else { >> System.out .println(getClass().getName() + " got Serial Port " >> + portName); >> } >> >> The Exception is never thrown, but the value of serialPort is null so I >> see the message. If I take the open() out of the try-catch, serialPort >> is not null. I'm baffled. >> >> Can anyone shed some light on this? >> >> I'm going to write a simpler test program using javaxcomm and see if it >> acts differently, and then try it with RXTX as well as with a wired >> connection for both javaxcomm and rxtx. >> >> > Hi Bruce, > > Finding a bluetooth that works well with RXTX on windows is a not very easy > in my experience. One that does work is the lego mindstorm adaptor. > > I'd love to hear from others if there are other adaptors that work. If you > have issues, please report them to the hardware vendor too. In our > experience with USB serial adaptors, they had many problems early on but now > work amazing well for the most part. > > RXTX exercises a large portion of the 'serial' api on all OSs. That means > it pokes bits some driver makers may not think are needed for bluetooth. For > instance, does hardware flow control make sense when you are beaming bits? > What do you do when rxtx asks if the buffer is overflowing? What does the > driver do when someone is toggling a pin? Getting the driver working for > reading and writing is probably the initial goal for serial while thinking > that everyone will go to USB HID at some point. When vendors see there is > still interest in the serial, they tend to take a second look. > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/d0b49fa4/attachment-0033.html From boesi.josi at gmx.net Thu Jul 17 05:41:52 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Thu, 17 Jul 2008 13:41:52 +0200 Subject: [Rxtx] Com-Port >= 10 Message-ID: <487F3000.5060700@gmx.net> Hi I use RXTX for accessing a RS232 port. That works fine, except when the port number is 10 or bigger. Then I get the following exception: gnu.io.PortInUseException: No error in open at gnu.io.RXTXPort.open(Native Method) at gnu.io.RXTXPort.(RXTXPort.java:84) at key.Keys.openPort(Keys.java:177) ... H?? _NO_ error in open? With putty I can open this port. I use an USB-Adapter and hence these high port numbers. But the same happens when I set the internal RS232 port in my notebook to 10. I use CommPortIdentifier.getPortIdentifiers() to get a list of all com-ports and all ports>=10 are in the list. Is there any chance to use a port>=10? Mfg Alex-- Wenn de L?ch net w?r un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From lyon at docjava.com Thu Jul 17 05:53:02 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 17 Jul 2008 07:53:02 -0400 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: Hi All, I have been able to construct a few prototype stepper motor interfaces to RXTX-based serial ports. Basically, I am able to drive the stepper motor from the DTR toggle on the serial port. Any programming language can do this, but I am doing it in RXTX, for now. Are people interested in Java-based stepper motor control? Is there a market for this stuff? Thanks! - Doug From Bruce.Boyes at rxtx.qbang.org Thu Jul 17 14:17:06 2008 From: Bruce.Boyes at rxtx.qbang.org (Bruce Boyes) Date: Thu, 17 Jul 2008 14:17:06 -0600 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: At 05:41 07/17/2008, you wrote: >Hi > > >I use RXTX for accessing a RS232 port. That works fine, except when the >port number is 10 or bigger. Then I get the following exception: > >gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... What does the code which generated this exception look like? We use USB serial adapters and typically COM ports are >20, and we don't have a problem. But there has to be a virtual serial port driver installed in the OS to create these COM numbers. Screen capture from Win XP Device Manager attached. The SUN spot port is another USB connection which is actually a wireless sensor. But its driver is previously installed and it's connected at the time of this capture. http://trackbot.systronix.com/AppNotes/appnoteimages/DeviceManagerSpotPort.jpg You can't generally reassign your internal UARTs to a different number, AFAIK. The first internal UART is COM1 and a modem is COM3 and I think you are stuck with those locations -- am I wrong? Anyway, you should only get the port in use Exception if another application has opened a connection to the port. Check that you don't have some other application such as a digital camera "helpful utility" which scans all ports every few seconds to see if you are plugging in a digital camera. I've seen that happen with some HP or Kodak software in the past, but it could be disabled. best regards Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From bboyes at systronix.com Thu Jul 17 14:25:20 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Thu, 17 Jul 2008 14:25:20 -0600 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: At 05:53 07/17/2008, Dr. Douglas Lyon wrote: >Hi All, >I have been able to construct a few prototype >stepper motor interfaces to RXTX-based serial ports. > >Basically, I am able to drive the stepper motor from the >DTR toggle on the serial port. Any programming language can >do this, but I am doing it in RXTX, for now. > >Are people interested in Java-based stepper motor control? > >Is there a market for this stuff? Maybe... how reliable is this approach? I would fear it's subject to GC, other apps, CPU speed and load. I've seen such things block my RXTX code for over a second at a time. How about throwing a $1 8-MIP AVR on the end of the serial port and have it drive the actual stepper pins, then just send it commands? I realize that sounds like a lot more work, but it could be much more robust. Free AVR C tools are available - we use them. FTDI makes a USB to state machine module too which might in itself be enough to run the stepper code. We haven't tried this yet. TI has really cheap MPS430 USB modules which could also run such code. Free dev tools that are really good. We've dabbled with this module. It's cool and you can even get one with a radio for a wireless driver if you want it, and they are also really cheap - like $20? best regards Bruce >Thanks! > - Doug >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From mringwal at inf.ethz.ch Thu Jul 17 14:56:25 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Thu, 17 Jul 2008 22:56:25 +0200 Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: <455C4F95-8DC2-4B04-824E-EFC5AF1BC8FF@inf.ethz.ch> On 17.07.2008, at 22:25, Bruce Boyes wrote: > How about throwing a $1 8-MIP AVR on the end of the serial port and > have it drive the actual stepper pins, then just send it commands? I > realize that sounds like a lot more work, but it could be much more > robust. Free AVR C tools are available - we use them. I'd like to add that there is even a GPL software USB implementation for the 8-bit AVR Atmels from Objective Development at http://www.obdev.at/products/avrusb/index-de.html Instead of rxtx you could then use libusb or libusbjava http://libusbjava.sourceforge.net/wp/ matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080717/4c9c0a16/attachment-0032.html From tjarvi at qbang.org Thu Jul 17 18:41:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:41:04 -0600 (MDT) Subject: [Rxtx] Com-Port >= 10 In-Reply-To: <487F3000.5060700@gmx.net> References: <487F3000.5060700@gmx.net> Message-ID: On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > Hi > > > I use RXTX for accessing a RS232 port. That works fine, except when the > port number is 10 or bigger. Then I get the following exception: > > gnu.io.PortInUseException: No error in open > at gnu.io.RXTXPort.open(Native Method) > at gnu.io.RXTXPort.(RXTXPort.java:84) > at key.Keys.openPort(Keys.java:177) > ... > > H?? _NO_ error in open? > There was an error in open but the C API error code was not translated leaving the default message (no error). -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jul 17 18:57:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 17 Jul 2008 18:57:30 -0600 (MDT) Subject: [Rxtx] is there a market for stepper motor/rxtx? In-Reply-To: References: Message-ID: On Thu, 17 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > I have been able to construct a few prototype > stepper motor interfaces to RXTX-based serial ports. > > Basically, I am able to drive the stepper motor from the > DTR toggle on the serial port. Any programming language can > do this, but I am doing it in RXTX, for now. > > Are people interested in Java-based stepper motor control? > > Is there a market for this stuff? > There are always people interested in learning how stepper motors work. That alone may cause a global shortage of old 5 1/4" floppy drive motors. If you have a computer and 2 or 3 stepper motors, then you could do some interesting things like have a telescope track a star, create a plotting device, ... Applications like that wont care if the results are not absolute realtime. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Fri Jul 18 02:49:37 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Fri, 18 Jul 2008 10:49:37 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <48805921.8090306@gmx.net> Arghs Thunderbird and mailing lists ... Btw. Bruce: SMTP error from remote server after RCPT command: host qbang.org[216.17.139.96]: 550 5.1.1 ... User unknown Bruce Boyes schrieb: > > What does the code which generated this exception look like? Well that's simple: First the code for selecting the right port (control is a JComboBox): for (Enumeration e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) { CommPortIdentifier portId = (CommPortIdentifier) e.nextElement(); control.addItem(portId.getName()); foundPort = true; } And after selecting the port open it (Konst.comPort contains the selected item): try { this.rsConn = new RXTXPort(Konst.comPort); this.rsConn.setSerialPortParams(Konst.comBaud, Konst.comData, Konst.comStop, Konst.comParity); rsConn.enableReceiveTimeout(Konst.comTimeoutReceive); rsInput = this.rsConn.getInputStream(); if (rsInput != null) return true; } catch (PortInUseException exc) { Log.log("RS232 Port %s kann nicht ge?ffnet werden.", Konst.comPort); exc.printStackTrace(); } catch (UnsupportedCommOperationException exc) { Log.log("Fehler beim setzen der RS232-Parameter: " + exc.getMessage()); exc.printStackTrace(); } The exception is raised by RXTXPort > > We use USB serial adapters and typically COM ports are >20, and we > > don't have a problem. But there has to be a virtual serial port > > driver installed in the OS to create these COM numbers. What do you mean by "virtual serial port"? Something like that: http://www.virtual-serial-port.com/ ? I have not installed such a software. > > You can't generally reassign your internal UARTs to a different > > number, AFAIK. The first internal UART is COM1 and a modem is COM3 > > and I think you are stuck with those locations -- am I wrong? At least on my notebook (with Vista) I can reassign the internal port in the device manager and after a restart it works at least in putty. Here* is a screenshot that shows my device manager ('Kommunikationsanschluss' is the internal com port; the Prolific is the USB-adapter, I've set it to 256 just for testing - and it works in putty) * http://www.bildercache.de/anzeige/20080718-084910-740.png > > Anyway, you should only get the port in use Exception if another > > application has opened a connection to the port. I'm absolutely sure that on my notebook no other software has opened the port. But the problem exists on all notebooks* on which we use our software - and on these notebooks are no "helpful apps" installed. * at least with Vista; note to me - I need to test it on XP btw thanks for your help cu boesi-- |?|/?/???\|?| |?|?| |?|/?/???\|????\|????| | / / /?\ | |_| | | | / / /?\ | (?) | |??? | \ \ \_/ | _ | |__| \ \ \_/ | ? /| `?| |_|\_\___/|_| |_|____|_|\_\___/|_|?? |_|?? From agusmunioz at gmail.com Sun Jul 20 18:03:13 2008 From: agusmunioz at gmail.com (=?ISO-8859-1?Q?Agustin_Mu=F1oz?=) Date: Sun, 20 Jul 2008 21:03:13 -0300 Subject: [Rxtx] Can write but not read in Windows Message-ID: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Hi I'm new on this serial port thing and I've started with a simple example posted in this list. I'm trying to develop an aplicaction that reads inputs in a COM port that is written by an specialized harwared connected through an USB. The target OS is Windows. First I try to run the next example but nothing happens. I've started a SerialPort monitoring software to see if something was happening, and I could see that the example actually writes but doesn't read anything. What kind of thing I must take into account when I work with COM ports? Thank in advance public class Simple implements SerialPortEventListener { CommPortIdentifier cpi; Enumeration ports; SerialPort port = null; InputStream input; OutputStream output; public static void main( String args[] ) { boolean done = false; Simple reader = new Simple( ); while ( !done ) { try { Thread.sleep(100); } catch (Exception e) {} } } public Simple( ) { System.out.println("Getting PortIdentifiers"); ports = CommPortIdentifier.getPortIdentifiers(); System.out.println("Availables " + ports.hasMoreElements()); while ( ports.hasMoreElements() ) { cpi = (CommPortIdentifier) ports.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { try { port = (SerialPort) cpi.open("Simple", 2000); port.addEventListener(this); port.notifyOnDataAvailable(true); output=port.getOutputStream(); input=port.getInputStream(); System.out.println("writing output"); output.write( new String("Hellow world").getBytes() ); } catch (Exception e) { e.printStackTrace(); } } } return; } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: System.out.print("BI\n"); case SerialPortEvent.OE: System.out.print("OE\n"); case SerialPortEvent.FE: System.out.print("FE\n"); case SerialPortEvent.PE: System.out.print("PE\n"); case SerialPortEvent.CD: System.out.print("CD\n"); case SerialPortEvent.CTS: System.out.print("CTS\n"); case SerialPortEvent.DSR: System.out.print("DSR\n"); case SerialPortEvent.RI: System.out.print("RI\n"); case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.print("Out Buff Empty\n"); break; case SerialPortEvent.DATA_AVAILABLE: byte in[] = new byte[800]; int ret = 0; System.out.println("Got Data Available"); try { ret = input.read( in, 0, 63 ); } catch (Exception e) { System.out.println("Input Exception"); } System.out.println("Printing read() results"); if ( ret > 0 ) { try { System.out.write( in, 0, ret ); System.out.println(); } catch ( Exception e ) { e.printStackTrace(); } } System.exit( 0 ); break; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080720/b81e7913/attachment-0029.html From sbp at medlinetec.eu Mon Jul 21 11:33:52 2008 From: sbp at medlinetec.eu (Santiago) Date: Mon, 21 Jul 2008 19:33:52 +0200 Subject: [Rxtx] JVM crash Message-ID: <4884C880.1020607@medlinetec.eu> I have got several jvm crashes when using rxtx and I have difficulties trying to understand the log. Can anyone help me? where could I get more info on JVM crashes? Thanks in advance # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=2936, tid=2544 # # Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x7d0d] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02abe400): JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] siginfo: ExceptionCode=0xc0000005, reading address 0x042ffa24 Registers: EAX=0x042ffa18, EBX=0x26b26758, ECX=0x0416f8f4, EDX=0x0416f618 ESP=0x0416f650, EBP=0x0416f978, ESI=0x26b26750, EDI=0x02abe400 EIP=0x10007d0d, EFLAGS=0x00010206 Top of Stack: (sp=0x0416f650) 0x0416f650: 0416f87c 7c91ee18 7c920738 ffffffff 0x0416f660: 7c920732 7c9206ab 7c9206eb 00000008 0x0416f670: 00000008 229fcd80 00000000 10007840 0x0416f680: 0416f8ac 7c91ee18 7c920738 ffffffff 0x0416f690: 7c920732 7c9206ab 7c9206eb 00000004 0x0416f6a0: 00000004 22a13e00 0416f6cc 7c81e4df 0x0416f6b0: 00000000 00000000 04300000 042ff000 0x0416f6c0: 042b0000 02f6df48 0416fb10 00000b78 Instructions: (pc=0x10007d0d) 0x10007cfd: 74 05 31 c0 eb 45 90 83 7d f4 00 74 3a 8b 45 f4 0x10007d0d: 83 78 0c 00 74 31 8d 85 e0 fc ff ff 8b 55 f4 52 Stack: [0x04120000,0x04170000], sp=0x0416f650, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x7d0d] v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter J homemonitoring.serial.Datex.sendPacket([I)V J homemonitoring.serial.Datex.sendPackType(I)V v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::Interpreter v ~BufferBlob::StubRoutines (1) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02ec6c00 JavaThread "Thread-4683" [_thread_blocked, id=88784, stack(0x04a80000,0x04ad0000)] 0x02ec6000 JavaThread "Thread-4682" [_thread_blocked, id=89480, stack(0x04a30000,0x04a80000)] 0x02ec5400 JavaThread "Thread-4681" [_thread_blocked, id=88728, stack(0x049e0000,0x04a30000)] 0x02b4ac00 JavaThread "Thread-4680" [_thread_blocked, id=88724, stack(0x04990000,0x049e0000)] 0x02b49c00 JavaThread "Thread-4679" [_thread_blocked, id=88696, stack(0x04940000,0x04990000)] 0x02b49000 JavaThread "Thread-4678" [_thread_blocked, id=88404, stack(0x048f0000,0x04940000)] 0x02b48000 JavaThread "Thread-4677" [_thread_blocked, id=88692, stack(0x04760000,0x047b0000)] 0x02b3e400 JavaThread "Thread-4674" [_thread_blocked, id=88688, stack(0x04710000,0x04760000)] 0x02b3d800 JavaThread "Thread-4672" [_thread_blocked, id=88660, stack(0x04170000,0x041c0000)] 0x02f76800 JavaThread "Thread-4673" [_thread_blocked, id=88864, stack(0x03f90000,0x03fe0000)] 0x02f75800 JavaThread "Thread-4671" [_thread_blocked, id=88656, stack(0x03f40000,0x03f90000)] 0x02b32400 JavaThread "Thread-4676" [_thread_blocked, id=88348, stack(0x03ef0000,0x03f40000)] 0x02b31800 JavaThread "Thread-4675" [_thread_blocked, id=88652, stack(0x03ea0000,0x03ef0000)] 0x02f53400 JavaThread "Thread-4670" [_thread_blocked, id=88648, stack(0x03e50000,0x03ea0000)] 0x0334fc00 JavaThread "Thread-4669" [_thread_blocked, id=88128, stack(0x03e00000,0x03e50000)] 0x0334f400 JavaThread "Thread-4668" [_thread_blocked, id=88132, stack(0x03db0000,0x03e00000)] 0x03341c00 JavaThread "Thread-4667" [_thread_blocked, id=88136, stack(0x03d60000,0x03db0000)] 0x03351800 JavaThread "Thread-4666" [_thread_blocked, id=88644, stack(0x03d10000,0x03d60000)] 0x033a4800 JavaThread "Thread-4665" [_thread_blocked, id=88640, stack(0x03cc0000,0x03d10000)] 0x033a4400 JavaThread "Thread-4664" [_thread_blocked, id=88636, stack(0x03c70000,0x03cc0000)] 0x02f55400 JavaThread "Thread-4663" [_thread_in_native, id=88832, stack(0x03c20000,0x03c70000)] 0x02f93800 JavaThread "Timer-104" daemon [_thread_blocked, id=84404, stack(0x04580000,0x045d0000)] 0x02ebc400 JavaThread "Timer-103" daemon [_thread_blocked, id=89848, stack(0x04530000,0x04580000)] 0x03356400 JavaThread "Timer-102" daemon [_thread_blocked, id=89148, stack(0x044e0000,0x04530000)] 0x02adb400 JavaThread "Timer-101" daemon [_thread_blocked, id=87528, stack(0x04490000,0x044e0000)] 0x02f34000 JavaThread "Timer-100" daemon [_thread_blocked, id=87156, stack(0x04440000,0x04490000)] 0x033a0400 JavaThread "Timer-99" daemon [_thread_blocked, id=85176, stack(0x043f0000,0x04440000)] 0x02ad2400 JavaThread "Timer-98" daemon [_thread_blocked, id=87660, stack(0x043a0000,0x043f0000)] 0x02a95800 JavaThread "Timer-97" daemon [_thread_blocked, id=87184, stack(0x04350000,0x043a0000)] 0x02ec1000 JavaThread "Timer-96" daemon [_thread_blocked, id=82436, stack(0x04300000,0x04350000)] 0x02ade400 JavaThread "Timer-95" daemon [_thread_blocked, id=83600, stack(0x03880000,0x038d0000)] 0x02e9ac00 JavaThread "Timer-94" daemon [_thread_blocked, id=76416, stack(0x04260000,0x042b0000)] 0x02e70800 JavaThread "Timer-93" daemon [_thread_blocked, id=83184, stack(0x04210000,0x04260000)] 0x02fad400 JavaThread "Timer-92" daemon [_thread_blocked, id=82544, stack(0x040d0000,0x04120000)] 0x0341a800 JavaThread "Timer-91" daemon [_thread_blocked, id=79332, stack(0x04fd0000,0x05020000)] 0x02b35400 JavaThread "Thread-102" [_thread_blocked, id=436, stack(0x03bd0000,0x03c20000)] 0x02b36000 JavaThread "Thread-101" [_thread_in_native, id=3308, stack(0x03b80000,0x03bd0000)] 0x02b37000 JavaThread "Thread-100" [_thread_blocked, id=3320, stack(0x03b30000,0x03b80000)] 0x02b38000 JavaThread "Thread-99" [_thread_in_native, id=1948, stack(0x03ac0000,0x03b10000)] 0x02f21400 JavaThread "Thread-98" [_thread_blocked, id=2864, stack(0x03a70000,0x03ac0000)] 0x02f22000 JavaThread "Thread-97" [_thread_in_native, id=2692, stack(0x03a20000,0x03a70000)] 0x02abc400 JavaThread "Thread-76" [_thread_blocked, id=3440, stack(0x041c0000,0x04210000)] =>0x02abe400 JavaThread "Thread-74" [_thread_in_native, id=2544, stack(0x04120000,0x04170000)] 0x03352c00 JavaThread "Thread-51" [_thread_blocked, id=3520, stack(0x039d0000,0x03a20000)] 0x03352400 JavaThread "Thread-52" [_thread_in_native, id=1792, stack(0x03980000,0x039d0000)] 0x03358800 JavaThread "Thread-30" [_thread_blocked, id=2852, stack(0x04080000,0x040d0000)] 0x02acbc00 JavaThread "Thread-29" [_thread_blocked, id=3724, stack(0x04030000,0x04080000)] 0x02acb400 JavaThread "Thread-28" [_thread_in_native, id=2204, stack(0x03fe0000,0x04030000)] 0x02fe5400 JavaThread "Thread-26" [_thread_blocked, id=3720, stack(0x037e0000,0x03830000)] 0x0337e800 JavaThread "Thread-27" [_thread_in_native, id=3844, stack(0x03790000,0x037e0000)] 0x003d5800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3072, stack(0x008d0000,0x00920000)] 0x03003c00 JavaThread "Thread-5" [_thread_in_native, id=2712, stack(0x03930000,0x03980000)] 0x033e6400 JavaThread "Thread-3" [_thread_blocked, id=2448, stack(0x038e0000,0x03930000)] 0x02f07c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=1572, stack(0x03830000,0x03880000)] 0x03395c00 JavaThread "Timer-0" [_thread_blocked, id=2060, stack(0x03730000,0x03780000)] 0x02ea3400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1108, stack(0x03200000,0x03250000)] 0x02e84800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2420, stack(0x03110000,0x03160000)] 0x02e83800 JavaThread "AWT-Shutdown" [_thread_blocked, id=1848, stack(0x030c0000,0x03110000)] 0x02e82c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=864, stack(0x03070000,0x030c0000)] 0x02ac6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2244, stack(0x02d70000,0x02dc0000)] 0x02ab8400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3184, stack(0x02d20000,0x02d70000)] 0x02ab7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3904, stack(0x02cd0000,0x02d20000)] 0x02ab6400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1420, stack(0x02c80000,0x02cd0000)] 0x02ab1800 JavaThread "Finalizer" daemon [_thread_blocked, id=2084, stack(0x02c30000,0x02c80000)] 0x02aad000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2104, stack(0x02be0000,0x02c30000)] Other Threads: 0x02aabc00 VMThread [stack: 0x02b90000,0x02be0000] [id=2616] 0x02ac7000 WatcherThread [stack: 0x02dc0000,0x02e10000] [id=3856] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 1088K, used 313K [0x229b0000, 0x22ad0000, 0x22e90000) eden space 1024K, 30% used [0x229b0000, 0x229fd540, 0x22ab0000) from space 64K, 6% used [0x22ab0000, 0x22ab0fe8, 0x22ac0000) to space 64K, 0% used [0x22ac0000, 0x22ac0000, 0x22ad0000) tenured generation total 11204K, used 8155K [0x22e90000, 0x23981000, 0x269b0000) the space 11204K, 72% used [0x22e90000, 0x23686e60, 0x23687000, 0x23981000) compacting perm gen total 12288K, used 3881K [0x269b0000, 0x275b0000, 0x2a9b0000) the space 12288K, 31% used [0x269b0000, 0x26d7a6a0, 0x26d7a800, 0x275b0000) ro space 8192K, 62% used [0x2a9b0000, 0x2aeb2a28, 0x2aeb2c00, 0x2b1b0000) rw space 12288K, 52% used [0x2b1b0000, 0x2b7f86b8, 0x2b7f8800, 0x2bdb0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Archivos de programa\Java\jre1.6.0_05\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Archivos de programa\Java\jre1.6.0_05\bin\msvcr71.dll 0x6d7c0000 - 0x6da10000 C:\Archivos de programa\Java\jre1.6.0_05\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x5dee0000 - 0x5dee8000 C:\WINDOWS\system32\rdpsnd.dll 0x76310000 - 0x76320000 C:\WINDOWS\system32\WINSTA.dll 0x597f0000 - 0x59844000 C:\WINDOWS\system32\NETAPI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d270000 - 0x6d278000 C:\Archivos de programa\Java\jre1.6.0_05\bin\hpi.dll 0x6d770000 - 0x6d77c000 C:\Archivos de programa\Java\jre1.6.0_05\bin\verify.dll 0x6d310000 - 0x6d32f000 C:\Archivos de programa\Java\jre1.6.0_05\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Archivos de programa\Java\jre1.6.0_05\bin\zip.dll 0x6d000000 - 0x6d12e000 C:\Archivos de programa\Java\jre1.6.0_05\bin\awt.dll 0x72f80000 - 0x72fa6000 C:\WINDOWS\system32\WINSPOOL.DRV 0x76340000 - 0x7635d000 C:\WINDOWS\system32\IMM32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x5b150000 - 0x5b188000 C:\WINDOWS\system32\uxtheme.dll 0x736e0000 - 0x73729000 C:\WINDOWS\system32\ddraw.dll 0x73b40000 - 0x73b46000 C:\WINDOWS\system32\DCIMAN32.dll 0x746b0000 - 0x746fb000 C:\WINDOWS\system32\MSCTF.dll 0x6d210000 - 0x6d263000 C:\Archivos de programa\Java\jre1.6.0_05\bin\fontmanager.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\shell32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\comctl32.dll 0x10000000 - 0x10012000 C:\Archivos de programa\Java\jre1.6.0_05\bin\rxtxSerial.dll 0x73d10000 - 0x73d37000 C:\WINDOWS\system32\crtdll.dll 0x6d570000 - 0x6d583000 C:\Archivos de programa\Java\jre1.6.0_05\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Archivos de programa\Java\jre1.6.0_05\bin\nio.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.DLL VM Arguments: java_command: C:\Archivos de programa\MedLineTec\homemonitoring\clases\homemonitoring.jar Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem USERNAME=CajaNegra1 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 2 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 1031536k(715884k free), swap 2496496k(2298084k free) vm_info: Java HotSpot(TM) Client VM (10.0-b19) for windows-x86 JRE (1.6.0_05-b13), built on Feb 22 2008 01:16:53 by "java_re" with MS VC++ 7.1 time: Mon Jul 21 17:56:29 2008 elapsed time: 259592 seconds From bboyes at systronix.com Mon Jul 21 18:38:13 2008 From: bboyes at systronix.com (Bruce Boyes) Date: Mon, 21 Jul 2008 18:38:13 -0600 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.co m> References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: Hi everyone So we have narrowed the Bluetooth issue a bit. Apparently even this code Class.forName("gnu.io.CommPortIdentifier"); causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR should not assert until I want to open the port and get an instance of it. This causes a BT adapter to connect and then immediately disconnect. Later when I try to explicitly open the serial port, DTR asserts again and stays asserted as it should. But by this time, for reasons I haven't fully traced, something in the BT adapter seems unable to recover (after the first DTR toggle) so my application can't really get a connection. I say "really" because RXTX gives me a SerialPort instance, and I can get Streams to it, but there is no live BT SPP connection between the host and slave BT adapters, so no data can transfer and my app eventually detects that and exits. I can see the DTR toggle with a cable connection and a scope (no BT adapters in the circuit at all). So this DTR toggle appears to be not a BT-related issue. So - is there a way to get RXTX to not toggle DTR when it runs some static initializer? Next on my list is to look at BlueCove... Thanks Bruce ------- WWW.SYSTRONIX.COM ---------- Real embedded Java and much more +1-801-534-1017 Salt Lake City, USA From johnny.luong at trustcommerce.com Mon Jul 21 19:24:22 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 21 Jul 2008 18:24:22 -0700 Subject: [Rxtx] RXTX apparently toggling DTR from static initializer? In-Reply-To: References: <988288430807201703u535dee51pbe8b14c934d138d8@mail.gmail.com> Message-ID: <488536C6.2060305@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Boyes wrote: | Hi everyone | | So we have narrowed the Bluetooth issue a bit. Apparently even this code | Class.forName("gnu.io.CommPortIdentifier"); | causes a brief toggle of DTR! About 6 msec worth. This is bad - DTR | should not assert until I want to open the port and get an instance | of it. This causes a BT adapter to connect and then immediately disconnect. | | Later when I try to explicitly open the serial port, DTR asserts | again and stays asserted as it should. But by this time, for reasons | I haven't fully traced, something in the BT adapter seems unable to | recover (after the first DTR toggle) so my application can't really | get a connection. I say "really" because RXTX gives me a SerialPort | instance, and I can get Streams to it, but there is no live BT SPP | connection between the host and slave BT adapters, so no data can | transfer and my app eventually detects that and exits. | | I can see the DTR toggle with a cable connection and a scope (no BT | adapters in the circuit at all). So this DTR toggle appears to be not | a BT-related issue. | | So - is there a way to get RXTX to not toggle DTR when it runs some | static initializer? | | Next on my list is to look at BlueCove... | | Thanks | | Bruce | | | | ------- WWW.SYSTRONIX.COM ---------- | Real embedded Java and much more | +1-801-534-1017 Salt Lake City, USA | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx | | Hi Bruce, I'm not so sure RXTX is doing a whole lot (relatively speaking) at least with respect to the version on the website. Assuming your host OS is some Windows variant, there are very few places where the port is opened (and by extension how the various lines get toggled): johnny-luongs-computer:~/bleh/rxtx/rxtx-2.1-7r2/src johnny$ grep CreateFile * ParallelImp.c: int fd = (int)CreateFile( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile CloseHandle termios.c: hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); termios.c: win32api: CreateFile(), SetupComm(), CreateEvent() termios.c: port->hComm = CreateFile( port->filename, If all your doing is loading the class into memory (not using open()) then your probably only running the function serial_test(). However, its not clear why that would be setting anything just from that, so I threw in a search on google and found this thread: http://www.codeguru.com/forum/showthread.php?s=&threadid=291244 It's not a solution but it might explain your 1st and 3rd issue. As for your second issue, I've encountered something like that with a USB to Serial device and the end result was I had to disconnect the device physically from the usb port and reattached before it start working again. In the end, we ended up removing the usb from the picture (the device had multiple configuration modes) and it worked pretty well. - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIhTbCAAoJEJdI1jIpgaUDfosQAKZVkyhWQHg6SGzUpdeAzHnk opEaPcblba+PUtauBKwk1DYiOZ0B1QXm1n+0LWSDqBAsJ2VdzAv9ddio1KhvMVUa PlSMnQijElcwLr/HmMiyriW3ZS4ytvqc0V8Ox4MZ5LSi8S8wiW0I4rUGW0uf6DhQ Sri4+aqYWu7Xw1U/fI2BmMP3xe7LAM9v/s11dzo+oJKL/AvEj7Mqj3tDYvV1RDiM 3WZE6eNcM874TmK8+f6fkpq/CvwY8dYiA/fNbiSxP+A5MQ/Jm7FM5CgOKxVjwGt2 bwY7w47safYyBlxitcs2MBen6di7BTclt+UFj9XFIqchuYFc23BYY6YZDDCH4+za xN3u0QlNzOz9M+YsUFsn9Oabl+WO0h0yL2mm+37W3zwUc34Az8MRyArw3EovKxGo kWu3ctnSYxJ8SYYi5Ol3nYZj8GC1mZEg/pAR2jTYkKZiHi/h7V8kZ0GoSchKBnLo d0L5mKu7OENn3GrOkUn4AL9p86fKaLornxxj5VqXKDpTAaQZctPOjn/MnaW46nGW NPUs1aa2/9PIBJqPfvWR87rY7EH0089jXNmzUSMAziQYNd7UvYTOMb35tKYn7N6Z bWDY/P9N+An3nhuR7feZ0SDmJGUdrCQVBqX+DvzmnO2H9FT1/xDcS3xmVlV4AezD FpfsxbhZ7iKsyM1Tb1+d =KpAv -----END PGP SIGNATURE----- From boesi.josi at gmx.net Wed Jul 23 00:36:14 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 23 Jul 2008 08:36:14 +0200 Subject: [Rxtx] Com-Port >= 10 In-Reply-To: References: <487F3000.5060700@gmx.net> Message-ID: <4886D15E.8020604@gmx.net> Trent Jarvi schrieb: > On Thu, 17 Jul 2008, Alexander 'boesi' B?secke wrote: > [...] >> H?? _NO_ error in open? >> > > There was an error in open but the C API error code was not translated > leaving the default message (no error). Thanks for the info. I've just seen that the errors "Port doesn't exist" and "Port is used" produce the same message. === I've done some more experiments and here are the results === Where are the error messages "gnu.io.PortInUseException: Unknown Application" and "gnu.io.NoSuchPortException"? Thanks to the help of this example http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports I've come to a solution: I changed the line this.rsConn = new RXTXPort(Konst.comPort); to CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(Konst.comPort); this.rsConn = (RXTXPort) portId.open("BN_Client", 50); Well and it works ... (with all my COM ports) Only one question is left behind: Why does RXTXPort act in this strange way? Referring to the exceptions and opening a 2 digit port ... cu boesi-- Als Java und Pascal auf der Suche nach dem Orakel von Delphi waren, wurde einer der beiden von einer Python in den gro?en C gebissen. Er schrie "Brainfuck!" und ihre Reise war VorBei... From pascal.brillard at elomobile.com Wed Jul 23 00:58:47 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Wed, 23 Jul 2008 08:58:47 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: Hi, I wrote a message few weeks ago about available baudrates but I received no answer. My question was, what are the available baudrates used by RxTx and if mine is not in, is it possible to add some ? Thanks for your answer. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/0c9a5938/attachment-0027.html From Martin.Oberhuber at windriver.com Wed Jul 23 08:00:16 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 23 Jul 2008 16:00:16 +0200 Subject: [Rxtx] Towards an RXTX release Message-ID: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Hi all, my company is working towards a commercial product in which we'd like to pick up RXTX plus fixes that have been made since the latest release (2.1-7r2). But, we can only pick up an officially released version of RXTX and I haven't been able to follow RXTX development too closely in the past few weeks, so I'm not totally up to date. Therefore, I would like to ask * What is the current status of LATEST in branch "commapi-0-0-1". Is it considered stable or have there been any risky checkins? * Are there any additional features that people would like to get done before cutting a release? We are particularly interested in total stability, and improving the situation around lockfiles (I have e-mailed the list on this topic before, and I could contribute patches for that). * What process would we like to set up towards a release. Unittests? How many Platforms? Create a new branch? How much time do we expect between "code freeze" and "release". For our product, we need a feature-complete, compiled and downloadable release candidate on August 31. We need this on Windows, Linux x86 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing department. Is everybody OK with working towards a release by that time? If yes, then I guess the next step will be to determine when we want to get milestone builds done and how to get the build / unittest machine set up. Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080723/c831d9c7/attachment-0026.html From iqzw2r602 at sneakemail.com Wed Jul 23 19:21:32 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 11:21:32 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <13557-75390@sneakemail.com> Awesome, I'm actually eagerly waiting for a new release. One thing I'd definitely like to have in there: WebStart support out of the box. My application uses webstart, and I found it quite tedious to make rxtx webstartable. You have to jump through a couple of hoops to make that happen, especially if you don't know your way around with these things. I think bluecove (JSR-82 [Bluetooth] implementation for J2SE - www.bluecove.org) sets a good example how Java libraries can handle the native library bundling problem: All is packed into a single JAR file, so all I do in netbeans to make my application run from a JNLP file is to tick the 'webstart' box, and that's it. No JNLP file editing, no native library fiddling, it just works. For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no native libraries packed) that we already have in the current version, with separate native libraries, and a new rxtx-ws.jar that has all native libraries embedded within it. I modified rxtx locally to make it webstartable out of the box - so I created the rxtx-ws.jar that I'm talking about above already. I'd be very happy to contribute that code. The modifications are minimal, all I did was to add a NativeLibLoader class, replace all calls to System.loadLibrary() with NativeLibLoader.loadLibrary() and packaging the native libraries into rxtx's JAR file. What do you think? On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < ...> wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > - What is the current status of LATEST in branch "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would like to get done > before cutting a release? We are particularly interested in total stability, > and improving the situation around lockfiles (I have e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a release. Unittests? > How many Platforms? Create a new branch? How much time do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine when we want to get > milestone builds done and how to get the build / unittest machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/3b7c9ffb/attachment-0026.html From tjarvi at qbang.org Wed Jul 23 21:32:46 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:32:46 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > my company is working towards a commercial product in which we'd like to > pick > up RXTX plus fixes that have been made since the latest release > (2.1-7r2). > > But, we can only pick up an officially released version of RXTX and I > haven't been able to follow RXTX development too closely in the past few > weeks, so I'm not totally up to date. Therefore, I would like to ask > > * What is the current status of LATEST in branch "commapi-0-0-1". > Is it considered stable or have there been any risky checkins? It should be safe. I've actually compiled from there for several OS's at work to test for our next release also. I'll have a few safe patches to synch work with rxtx as well. I'm at the Linux symposium this week but will return to the release bits Sunday. Once my sandbox is the same as CVS, I'll be tagging it -8pre1 and put some binaries up for wider testing by users. > * Are there any additional features that people would like to get > done before cutting a release? We are particularly interested in total > stability, and improving the situation around lockfiles (I have e-mailed > the list on this topic before, and I could contribute patches for that). I'll be trying to put george's SMP patch in for stability. But if you have more we can try to get it in. There are a couple minor things I want to correct that I can discuss Sunday before putting them in. > * What process would we like to set up towards a release. > Unittests? How many Platforms? Create a new branch? How much time do we > expect between "code freeze" and "release". I have a hard code freeze in ~october that I want to be well ahead of. There are test suites I run at work I can share the results of for sol64, maci maci64 Linux Linux64 windows and perhaps window64. These are hthe platforms I'll be looking at and have building right now. The test suite is slowly moving towards something that could be shared (months to years) but unit tests are a good thing too. I'd suggest we get as much in next week and be selective about patches after that. > > For our product, we need a feature-complete, compiled and downloadable > release candidate on August 31. We need this on Windows, Linux x86 > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed off to our > testing department. > > Is everybody OK with working towards a release by that time? Yes. I can't picture changing much after that. > > If yes, then I guess the next step will be to determine when we want to > get milestone builds done and how to get the build / unittest machine > set up. Why don't we try to get a pre1 set of binaries out early next week that anyone can test. If you have patches that need to get in, post them here. I'll try to post the patches I have Sunday. As for Unit tests, we do not have anything. I probably won't have much time to work on them. I can share extensive functional testing results for the platforms mentioned. Unit tests would be a great addition. > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > From tjarvi at qbang.org Wed Jul 23 21:53:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Jul 2008 21:53:07 -0600 (MDT) Subject: [Rxtx] Towards an RXTX release In-Reply-To: <13557-75390@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: Hi iqzw2r602 :) The idea sounds OK. We can probably look at that after we are sure the basic functionality satisfies everyone. On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to make rxtx > webstartable. You have to jump through a couple of hoops to make that > happen, especially if you don't know your way around with these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org) sets a good example how Java libraries can handle the > native library bundling problem: All is packed into a single JAR file, so > all I do in netbeans to make my application run from a JNLP file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no > native libraries packed) that we already have in the current version, with > separate native libraries, and a new rxtx-ws.jar that has all native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box - so I > created the rxtx-ws.jar that I'm talking about above already. I'd be very > happy to contribute that code. The modifications are minimal, all I did was > to add a NativeLibLoader class, replace all calls to System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < > ...> wrote: > >> Hi all, >> >> my company is working towards a commercial product in which we'd like to >> pick >> up RXTX plus fixes that have been made since the latest release (2.1-7r2). >> >> But, we can only pick up an officially released version of RXTX and I >> haven't been able to follow RXTX development too closely in the past few >> weeks, so I'm not totally up to date. Therefore, I would like to ask >> >> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >> considered stable or have there been any risky checkins? >> - Are there any additional features that people would like to get done >> before cutting a release? We are particularly interested in total stability, >> and improving the situation around lockfiles (I have e-mailed the list on >> this topic before, and I could contribute patches for that). >> - What process would we like to set up towards a release. Unittests? >> How many Platforms? Create a new branch? How much time do we expect between >> "code freeze" and "release". >> >> For our product, we need a feature-complete, compiled and downloadable >> release candidate on August 31. We need this on Windows, Linux x86 32-bit >> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >> department. >> >> Is everybody OK with working towards a release by that time? >> >> If yes, then I guess the next step will be to determine when we want to get >> milestone builds done and how to get the build / unittest machine set up. >> >> Thanks, >> -- >> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > From iqzw2r602 at sneakemail.com Wed Jul 23 22:42:59 2008 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Thu, 24 Jul 2008 14:42:59 +1000 Subject: [Rxtx] Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> Message-ID: <20980-23424@sneakemail.com> Sorry, my name's Uwe, I posted here before :) - I don't wanna be anonymous, just like to prevent spam where possible ;) I could only test it so far on Win32, but I'll get a Mac soon to test it on there - for the other platforms I'd have to rely on someone in the rxtx community to test the functionality. I'll send you a patch as soon as I have it tested on Mac OSX. It'd be really cool to integrate it into an official version; having a separate branch of rxtx for that sucks ;) Cheers, Uwe On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org |rxtx.orgmailing list| < ...> wrote: > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are sure the > basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com wrote: > > Awesome, I'm actually eagerly waiting for a new release. >> >> One thing I'd definitely like to have in there: >> WebStart support out of the box. >> >> My application uses webstart, and I found it quite tedious to make rxtx >> webstartable. You have to jump through a couple of hoops to make that >> happen, especially if you don't know your way around with these things. I >> think bluecove (JSR-82 [Bluetooth] implementation for J2SE - >> www.bluecove.org) sets a good example how Java libraries can handle the >> native library bundling problem: All is packed into a single JAR file, so >> all I do in netbeans to make my application run from a JNLP file is to >> tick >> the 'webstart' box, and that's it. No JNLP file editing, no native library >> fiddling, it just works. >> >> For RXTX, I think it'd be best to offer two versions: The rxtx.jar (no >> native libraries packed) that we already have in the current version, with >> separate native libraries, and a new rxtx-ws.jar that has all native >> libraries embedded within it. >> >> I modified rxtx locally to make it webstartable out of the box - so I >> created the rxtx-ws.jar that I'm talking about above already. I'd be very >> happy to contribute that code. The modifications are minimal, all I did >> was >> to add a NativeLibLoader class, replace all calls to System.loadLibrary() >> with NativeLibLoader.loadLibrary() and packaging the native libraries into >> rxtx's JAR file. >> >> What do you think? >> >> >> On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin >> Martin.Oberhuber-at-windriver.com |rxtx.org mailing list| < >> ...> wrote: >> >> Hi all, >>> >>> my company is working towards a commercial product in which we'd like to >>> pick >>> up RXTX plus fixes that have been made since the latest release >>> (2.1-7r2). >>> >>> But, we can only pick up an officially released version of RXTX and I >>> haven't been able to follow RXTX development too closely in the past few >>> weeks, so I'm not totally up to date. Therefore, I would like to ask >>> >>> - What is the current status of LATEST in branch "commapi-0-0-1". Is it >>> considered stable or have there been any risky checkins? >>> - Are there any additional features that people would like to get done >>> before cutting a release? We are particularly interested in total >>> stability, >>> and improving the situation around lockfiles (I have e-mailed the list >>> on >>> this topic before, and I could contribute patches for that). >>> - What process would we like to set up towards a release. Unittests? >>> How many Platforms? Create a new branch? How much time do we expect >>> between >>> "code freeze" and "release". >>> >>> For our product, we need a feature-complete, compiled and downloadable >>> release candidate on August 31. We need this on Windows, Linux x86 32-bit >>> (Redhat RHEL 4), and Solaris 9. This will be handed off to our testing >>> department. >>> >>> Is everybody OK with working towards a release by that time? >>> >>> If yes, then I guess the next step will be to determine when we want to >>> get >>> milestone builds done and how to get the build / unittest machine set up. >>> >>> Thanks, >>> -- >>> *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* >>> Target Management Project Lead, DSDP PMC Member >>> http://www.eclipse.org/dsdp/tm >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080724/17cae26d/attachment-0026.html From Martin.Oberhuber at windriver.com Thu Jul 24 04:46:11 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Jul 2008 12:46:11 +0200 Subject: [Rxtx] [Suspected Spam][Blocked Sender]Re: Towards an RXTX release In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806C572A7@ism-mail03.corp.ad.wrs.com> Hi Trent, the one thing that I need to get in is improvements for port locking on Linux: * System.property or Java API to specify directory for lockfiles * System.property or Java API to soft-off port locking * Improved error reporting when locking fails, including the file/folder that was found preventing the port lock, as part of an exception These are the supposedly safe must-haves for me, and what I'm ready to contribute. Since these things do add some kind of new API (ability to specify lockfile folder), I would suggest naming the new release "rxtx 2.2" rather than 2.1-8. The first Release Candidat would then be 2.2-pre1 if you want. If we could get some ioctl method in place for port locking on Linux, that would be great but I'm not sure how much I could help here since it's not my area of expertise. If you could share functional test results that's great, if you could also share the code that runs the functional tests that would be even greater; for Unittests, I'm wondering how much can actually be done without some real hardware and a cross-cable connecting two ports; on the other hand, software port emulations such as com0com could probably help setting up a unittest suite on Windows at least. http://com0com.sourceforge.net/ Anyway, I'll start working on the port locking enhancements as soon as I can. Is there any preference for using a System Property or Java API? If not, then I'd go with a System Property, since we are talking about a system-wide configuration setting here. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Thursday, July 24, 2008 5:33 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: [Suspected Spam][Blocked Sender]Re: [Rxtx] Towards > an RXTX release > > On Wed, 23 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > my company is working towards a commercial product in which > we'd like to > > pick > > up RXTX plus fixes that have been made since the latest release > > (2.1-7r2). > > > > But, we can only pick up an officially released version of > RXTX and I > > haven't been able to follow RXTX development too closely in > the past few > > weeks, so I'm not totally up to date. Therefore, I would like to ask > > > > * What is the current status of LATEST in branch "commapi-0-0-1". > > Is it considered stable or have there been any risky checkins? > > It should be safe. I've actually compiled from there for > several OS's at > work to test for our next release also. I'll have a few safe > patches to > synch work with rxtx as well. I'm at the Linux symposium > this week but > will return to the release bits Sunday. > > Once my sandbox is the same as CVS, I'll be tagging it -8pre1 > and put some > binaries up for wider testing by users. > > > * Are there any additional features that people would like to get > > done before cutting a release? We are particularly > interested in total > > stability, and improving the situation around lockfiles (I > have e-mailed > > the list on this topic before, and I could contribute > patches for that). > > I'll be trying to put george's SMP patch in for stability. > But if you > have more we can try to get it in. There are a couple minor > things I want > to correct that I can discuss Sunday before putting them in. > > > * What process would we like to set up towards a release. > > Unittests? How many Platforms? Create a new branch? How > much time do we > > expect between "code freeze" and "release". > > I have a hard code freeze in ~october that I want to be well > ahead of. > There are test suites I run at work I can share the results > of for sol64, > maci maci64 Linux Linux64 windows and perhaps window64. > These are hthe > platforms I'll be looking at and have building right now. > The test suite > is slowly moving towards something that could be shared > (months to years) > but unit tests are a good thing too. > > I'd suggest we get as much in next week and be selective > about patches > after that. > > > > > For our product, we need a feature-complete, compiled and > downloadable > > release candidate on August 31. We need this on Windows, Linux x86 > > 32-bit (Redhat RHEL 4), and Solaris 9. This will be handed > off to our > > testing department. > > > > Is everybody OK with working towards a release by that time? > > Yes. I can't picture changing much after that. > > > > > If yes, then I guess the next step will be to determine > when we want to > > get milestone builds done and how to get the build / > unittest machine > > set up. > > Why don't we try to get a pre1 set of binaries out early next > week that > anyone can test. If you have patches that need to get in, > post them here. > I'll try to post the patches I have Sunday. > > As for Unit tests, we do not have anything. I probably won't > have much > time to work on them. I can share extensive functional > testing results > for the platforms mentioned. Unit tests would be a great addition. > > > > > Thanks, > > -- > > Martin Oberhuber, Senior Member of Technical Staff, Wind River > > Target Management Project Lead, DSDP PMC Member > > http://www.eclipse.org/dsdp/tm > > > > > > > From tjarvi at qbang.org Thu Jul 24 12:04:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Jul 2008 12:04:57 -0600 (MDT) Subject: [Rxtx] [RxTx] Baudrates In-Reply-To: References: Message-ID: On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I received > no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Jul 25 09:55:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 17:55:34 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Hi all, when updating my workspace to the latest, I noticed that SerialImp.c appears to already contain some fixes which have not yet been properly reviewed. The corresponding CVS Checkin comment includes [...] I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 There is also a yet unanswered question here: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 Joachim if you are listening could you take a look? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Martin.Oberhuber at windriver.com Fri Jul 25 10:08:33 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 25 Jul 2008 18:08:33 +0200 Subject: [Rxtx] What Character Encodign is used for ChangeLog Message-ID: <460801A4097E3D4CA04CC64EE648584806CF0B28@ism-mail03.corp.ad.wrs.com> Hi All, I'm wondering what character encoding is being used for the "ChangeLog" file in RXTX? There is an entry for "Nebojsa" which includes a character that doesn't display properly in any of the ISO-8859-1 UTF-8 Windows Cp1252 encodings. install-japanese.html appears to be UTF-8 though, and so seems ChangePackage.sh. My personal request would be to use ISO-8859-1 only (or even US-ASCII restricted to 7 bit only) in the actual code (src/) portions, and use UTF-8 in those parts of documentation that must use special characters. Any concerns? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080725/242e1238/attachment-0024.html From kintel at sim.no Fri Jul 25 10:34:03 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 25 Jul 2008 18:34:03 +0200 Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: <519C4153-C105-4382-8A00-317A941D50BA@sim.no> Hi, Related to this, it would be nice to get 64-bit support into the next release. I submitted a patch to SerialImp.c earlier to partially fix this. I think it's still on Trent's list to look closer at it though. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Sat Jul 26 01:17:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:17:39 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > when updating my workspace to the latest, I noticed that > SerialImp.c appears to already contain some fixes which > have not yet been properly reviewed. The corresponding > CVS Checkin comment includes > > [...] > I need to further review the following: > http://bugzilla.qbang.org/show_bug.cgi?id=53 > http://bugzilla.qbang.org/show_bug.cgi?id=46 > http://bugzilla.qbang.org/show_bug.cgi?id=41 > > There is also a yet unanswered question here: > http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 > Joachim if you are listening could you take a look? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > For 46 53, I'd suggest waiting until I repost george's patch. We have had extensive discussions about this on the list. I'll repost the patch Sunday. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jul 26 01:22:27 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 26 Jul 2008 01:22:27 -0600 (MDT) Subject: [Rxtx] SerialImp.c -- review pending on some fixes? In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF0B25@ism-mail03.corp.ad.wrs.com> Message-ID: On Sat, 26 Jul 2008, Trent Jarvi wrote: > On Fri, 25 Jul 2008, Oberhuber, Martin wrote: > >> Hi all, >> >> when updating my workspace to the latest, I noticed that >> SerialImp.c appears to already contain some fixes which >> have not yet been properly reviewed. The corresponding >> CVS Checkin comment includes >> >> [...] >> I need to further review the following: >> http://bugzilla.qbang.org/show_bug.cgi?id=53 >> http://bugzilla.qbang.org/show_bug.cgi?id=46 >> http://bugzilla.qbang.org/show_bug.cgi?id=41 >> >> There is also a yet unanswered question here: >> http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 >> Joachim if you are listening could you take a look? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> > > For 46 53, I'd suggest waiting until I repost george's patch. We have had > extensive discussions about this on the list. I'll repost the patch > Sunday. > The patches in CVS have been discussed on the list but are quite old. Attached are two options we have to resolve smp/mulitcore deadlocks that have been posted to the list. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -3 -r1.27.2.75 RXTXPort.java --- src/RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ src/RXTXPort.java 10 Dec 2007 16:58:20 -0000 @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } -------------- next part -------------- *** RXTXPort.java 20 Jun 2006 15:06:08 -0000 1.86 --- RXTXPort.java 3 Jan 2008 21:51:02 -0000 *************** *** 70,76 **** protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static Zystem z; static { --- 70,76 ---- protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ! private static volatile Zystem z; static { *************** *** 86,92 **** /** Initialize the native library */ private native static void Initialize(); ! boolean MonitorThreadAlive=false; /** * Open the named port --- 86,92 ---- /** Initialize the native library */ private native static void Initialize(); ! private volatile boolean MonitorThreadAlive=false; /** * Open the named port *************** *** 128,138 **** throws PortInUseException; ! /* dont close the file while accessing the fd */ ! int IOLocked = 0; /** File descriptor */ ! private int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty --- 128,141 ---- throws PortInUseException; ! /** ! * dont close the file while accessing the fd ! * volatile so reads don't have to be synchronzied ! */ ! private volatile int IOLocked = 0; /** File descriptor */ ! private volatile int fd = 0; /** a pointer to the event info structure used to share information between threads so write threads can send output buffer empty *************** *** 140,151 **** long for 64 bit pointers. */ ! long eis = 0; /** pid for lock files */ ! int pid = 0; /** DSR flag **/ ! static boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); --- 143,154 ---- long for 64 bit pointers. */ ! volatile long eis = 0; /** pid for lock files */ ! volatile int pid = 0; /** DSR flag **/ ! static volatile boolean dsrFlag = false; /** Output stream */ private final SerialOutputStream out = new SerialOutputStream(); *************** *** 220,226 **** throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds --- 223,229 ---- throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ ! private volatile int speed=9600; /** * @return int representing the baudrate * This will not behave as expected with custom speeds *************** *** 233,239 **** } /** Data bits port parameter */ ! private int dataBits=DATABITS_8; /** * @return int representing the databits */ --- 236,242 ---- } /** Data bits port parameter */ ! private volatile int dataBits=DATABITS_8; /** * @return int representing the databits */ *************** *** 245,251 **** } /** Stop bits port parameter */ ! private int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ --- 248,254 ---- } /** Stop bits port parameter */ ! private volatile int stopBits=SerialPort.STOPBITS_1; /** * @return int representing the stopbits */ *************** *** 257,263 **** } /** Parity port parameter */ ! private int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ --- 260,266 ---- } /** Parity port parameter */ ! private volatile int parity= SerialPort.PARITY_NONE; /** * @return int representing the parity */ *************** *** 270,276 **** /** Flow control */ ! private int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE --- 273,279 ---- /** Flow control */ ! private volatile int flowmode = SerialPort.FLOWCONTROL_NONE; /** * @param flowcontrol FLOWCONTROL_NONE is default * @see javax.comm.SerialPort#FLOWCONTROL_NONE *************** *** 353,359 **** /** Receive timeout control */ ! private int timeout; /** * @return int the timeout --- 356,362 ---- /** Receive timeout control */ ! private volatile int timeout; /** * @return int the timeout *************** *** 425,431 **** /** Receive threshold control */ ! private int threshold = 0; /** * @param thresh threshold --- 428,434 ---- /** Receive threshold control */ ! private volatile int threshold = 0; /** * @param thresh threshold *************** *** 484,491 **** These are native stubs... */ ! private int InputBuffer=0; ! private int OutputBuffer=0; /** * @param size */ --- 487,494 ---- These are native stubs... */ ! private volatile int InputBuffer=0; ! private volatile int OutputBuffer=0; /** * @param size */ *************** *** 601,610 **** /** Serial Port Event listener */ ! private SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); --- 604,613 ---- /** Serial Port Event listener */ ! private volatile SerialPortEventListener SPEventListener; /** Thread to monitor data */ ! private volatile MonitorThread monThread; /** Process SerialPortEvents */ native void eventLoop(); *************** *** 612,618 **** /** * @return boolean true if monitor thread is interrupted */ ! boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { --- 615,621 ---- /** * @return boolean true if monitor thread is interrupted */ ! volatile boolean monThreadisInterrupted=true; private native void interruptEventLoop( ); public boolean checkMonitorThread() { *************** *** 781,787 **** * @throws TooManyListenersException */ ! boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException --- 784,790 ---- * @throws TooManyListenersException */ ! volatile boolean MonitorThreadLock = true; public void addEventListener( SerialPortEventListener lsnr ) throws TooManyListenersException *************** *** 1037,1043 **** private native void nativeClose( String name ); /** */ ! boolean closeLock = false; public void close() { synchronized (this) { --- 1040,1046 ---- private native void nativeClose( String name ); /** */ ! volatile boolean closeLock = false; public void close() { synchronized (this) { *************** *** 1103,1108 **** --- 1106,1113 ---- } z.finalize(); } + + private final Object IOLock = new Object(); /** Inner class for SerialOutputStream */ class SerialOutputStream extends OutputStream *************** *** 1120,1144 **** { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! IOLocked--; ! throw new IOException(); } ! try ! { writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] --- 1125,1147 ---- { return; } ! synchronized( IOLock ) { ! IOLocked++; } ! try { ! waitForTheNativeCodeSilly(); ! if ( fd == 0 ) ! { ! throw new IOException("Filedescriptor is 0"); ! } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** * @param b[] *************** *** 1156,1175 **** return; } if ( fd == 0 ) throw new IOException(); ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** --- 1159,1177 ---- return; } if ( fd == 0 ) throw new IOException(); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** *************** *** 1195,1219 **** { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException(); if ( monThreadisInterrupted == true ) { return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ --- 1197,1220 ---- { z.reportln( "Entering RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send) */ ); } ! if ( fd == 0 ) throw new IOException("Filedescriptor is 0"); if ( monThreadisInterrupted == true ) { return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized( IOLock ) { + IOLocked--; + } } } /** */ *************** *** 1229,1253 **** z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ ! try ! { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } ! catch( IOException e ) ! { IOLocked--; - throw e; } - IOLocked--; } } --- 1230,1251 ---- z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); ! /* ! this is probably good on all OS's but for now ! just sendEvent from java on Sol ! */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); ! } finally { IOLocked--; } } } *************** *** 1278,1291 **** { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! IOLocked++; ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); ! try ! { int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); --- 1276,1290 ---- { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() L" ); ! waitForTheNativeCodeSilly(); ! if (debug_read_results) ! z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); *************** *** 1294,1300 **** } finally { ! IOLocked--; } } /** --- 1293,1301 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1319,1328 **** { return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); ! try ! { result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); --- 1320,1330 ---- { return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { ! waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); *************** *** 1330,1336 **** } finally { ! IOLocked--; } } /* --- 1332,1340 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /* *************** *** 1430,1439 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1434,1445 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1441,1447 **** } finally { ! IOLocked--; } } --- 1447,1455 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } *************** *** 1539,1548 **** z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! IOLocked++; ! waitForTheNativeCodeSilly(); try { result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); --- 1547,1558 ---- z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } ! synchronized( IOLock ) { ! IOLocked++; ! } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); *************** *** 1550,1556 **** } finally { ! IOLocked--; } } /** --- 1560,1568 ---- } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } /** *************** *** 1565,1582 **** } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! IOLocked++; ! try ! { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } ! finally ! { ! IOLocked--; } } } --- 1577,1595 ---- } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); ! synchronized( IOLock ) { ! IOLocked++; ! } ! try { int r = nativeavailable(); if ( debug_verbose ) z.reportln( "RXTXPort:available() returning " + r ); return r; ! } finally { ! synchronized( IOLock ) { ! IOLocked--; ! } } } } From defiantlew at yahoo.com.au Sun Jul 27 04:28:07 2008 From: defiantlew at yahoo.com.au (Lew L) Date: Sun, 27 Jul 2008 20:28:07 +1000 Subject: [Rxtx] rxtx and USB support? Message-ID: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Hi all, Something I am not quite clear on is whether RXTX supports USB comms? It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. Cheers Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080727/3fe3207b/attachment-0023.html From tjarvi at qbang.org Sun Jul 27 19:43:09 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 27 Jul 2008 19:43:09 -0600 (MDT) Subject: [Rxtx] rxtx and USB support? In-Reply-To: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> References: <006901c8efd3$8f084180$0100000a@ll35e1d2095fc2> Message-ID: On Sun, 27 Jul 2008, Lew L wrote: > Hi all, > > Something I am not quite clear on is whether RXTX supports USB comms? > > It seems any mention of USB is in the context of being used via a USB to serial rs232 adapter/converter. > > Cheers > Lew > Hi Lew, RXTX supports POSIX ttys - sometimes by converting APIs into POSIX like APIs. In practical terms this means it supports the serial interface provided by operating systems prior to USB. USB devices may support the API to various degrees via their drivers. If they support the API well, then RXTX works. RXTX does not claim support for USB. Some USB devices claim support for traditional serial APIs. If they do it well, rxtx works. JSR80 is a Java API for generic USB HID support. There are other USB HID interfaces available that specialize in certain applications you may find. -- Trent Jarvi tjarvi at qbang.org From pascal.brillard at elomobile.com Tue Jul 29 02:09:31 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 10:09:31 +0200 Subject: [Rxtx] [RxTx] Baudrates Message-ID: -----Message d'origine----- De : Trent Jarvi [mailto:tjarvi at qbang.org] Envoy? : jeudi 24 juillet 2008 20:05 ? : Pascal BRILLARD Cc : rxtx at qbang.org Objet : Re: [Rxtx] [RxTx] Baudrates On Wed, 23 Jul 2008, Pascal BRILLARD wrote: > Hi, > > I wrote a message few weeks ago about available baudrates but I > received no answer. > > My question was, what are the available baudrates used by RxTx and if > mine is not in, is it possible to add some ? > > Thanks for your answer. > > Pascal > Hi Pascal The cvs version of rxtx should not fail on any baudrate with linux and windows. It will round off to some divisor/baudbase near what you select. In the past, the baud rates had been limited to a list defined decades ago and was generally accepted as standard baud rates. I assume that Mac and Solaris are fairly limited in what they can do in rxtx but that may be something that can be improved. -- Trent Jarvi tjarvi at qbang.org Hi Trent, Thanks for this answer. In fact, after solving many problems installing silabs driver, I tried to open my USB to UART bridge at 128000 bauds, which is normally a standart. My real speed should by 125000 but it less than 3% higher, which should not be a problem. The problem is that it still tell me UnsupportedCommOperationException : Invalid Parameter at 128000 bauds. I have download the CVS version of RXTX (without commapi) and I have found in SerialImp.c the lines : #ifdef B128000 case 128000: return B128000; #endif So I guess that the speed should be supported, I am wrong ? If not, what should I do to make this speed available ? Thanks in advance. Pascal From pascal.brillard at elomobile.com Tue Jul 29 08:40:22 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 29 Jul 2008 16:40:22 +0200 Subject: [Rxtx] How to recompile RXTX ? Message-ID: Hi, I am trying to recompile rxtx to add the desired baudrate. I have modify some files (SerialImp.h and SerialImp.c) to activate 128000 bauds. I have now to recompile the gnu.io library to check my modification. I have downloaded the CVS version and I execute the command ./configure. I have added to /usr/java/jdk.../jre/lib/ext the original RXTXcomm.jar (which contains 52 files). After that, I execute make and this create a new RXTXcomm.jar in the rxtx-devel directory. The problem is that this new jar file doesn't include all the file needed : - Configure.class to Configure$4.class - LPRPort$MonitorThread.class - LPRPort$ParallelInputStream.class - LPRPort$ParallelOutputStream.class - LPRPort.class - RXTXCommDriver.class - RXTXPort$MonitorThread.class - RXTXPort$SerialInputSream.class - RXTXPort$SerialOutputStream.class - RXTXPort.class - RXTXVersion.class - UnsupportedLoggerException.class - Zystem.class So only 17 files. This doesn't contain for example CommPortIdentifier which is needed to search port. What I am doing wrong ? What is the official way to recompile the CVS source files ? Thanks. Pascal From Martin.Oberhuber at windriver.com Tue Jul 29 13:08:02 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Jul 2008 21:08:02 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy Message-ID: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Hi all, I have investigated what it would take to enhance RXTX such that serial ports can be locked properly on Linux. I found that most distributions follow the Linux File System Standard, so the current RXTX code works for them. But redhat (RHEL4, RHEL5) does something different: on redhat distributions, the /var/lock directory is owned by group "lock" which is other than the group "uucp" which owns the ports themselves. In order to allow users to create lockfiles, they use a special setuid program (/usr/sbin/lockdev) which is capable of creating the locks. Redhat has even patched the minicom program in order to use the lockdev program. So, if RXTX based applications are to work "out of the box" on Redhat like other programs, it looks like there is no way around calling lockdev. One drawback is that the program is not documented: See http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html which means there can be bugs, or redhat can change its functionality without notice. What does the group here think, should rxtx support Redhat's liblockdev-baudboy ? Some more URLs for reference: Redhat's patch to minicom http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 3.1-rh.patch.html RPMFind for lockdev-baudboy-devel http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- devel-1.0.3-3.i586.rpm.html Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/6d60e9c4/attachment-0020.html From johnny.luong at trustcommerce.com Tue Jul 29 14:32:02 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 29 Jul 2008 13:32:02 -0700 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <488F7E42.4040303@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oberhuber, Martin wrote: | Hi all, | | I have investigated what it would take to enhance RXTX such that | serial ports can be locked properly on Linux. | | I found that most distributions follow the Linux File System Standard, | so the current RXTX code works for them. | | But redhat (RHEL4, RHEL5) does something different: on redhat | distributions, the /var/lock directory is owned by group "lock" | which is other than the group "uucp" which owns the ports themselves. | In order to allow users to create lockfiles, they use a special | setuid program (/usr/sbin/lockdev) which is capable of creating | the locks. | | Redhat has even patched the minicom program in order to use the | lockdev program. So, if RXTX based applications are to work | "out of the box" on Redhat like other programs, it looks like | there is no way around calling lockdev. | | One drawback is that the program is not documented: See | http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html | which means there can be bugs, or redhat can change its | functionality without notice. | | What does the group here think, should rxtx support Redhat's | liblockdev-baudboy ? Some more URLs for reference: | | Redhat's patch to minicom | http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.83.1-rh.patch.html | RPMFind for lockdev-baudboy-devel | http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy-devel-1.0.3-3.i586.rpm.html | | | Cheers, | -- | *Martin Oberhuber*, Senior Member of Technical Staff, *Wind River* | Target Management Project Lead, DSDP PMC Member | http://www.eclipse.org/dsdp/tm | | | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Martin, My two cents: If the plan is to provide an RXTX binary package for RH, then it should be included it as part of the SRPM/RPM provided. It certainly would make life easier for those users (certainly for a Fedora user such as myself as I ended up kludging it by adding myself to the group) and there are probably various legacy reasons for doing so. As for in general, it might be best to explicitly state where the binary has been used successfully so that the expectations are managed correctly. Best, - -Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJIj34+AAoJEJdI1jIpgaUDaaAP/RjRpTEzFAaU76zxlwteArsA Mx79dfIdlKqyl8PwksDe05D68cunvGt8wAwjVS1KuhsYABvntt4oikv/S5/v2sWl /uP9DtIFjQ2UL/r1+8nqH5E7GqQauEpASBlyRuBOsKVqqCvOW/g5g7Q3d2S8SL/V 5ylZEawRFUye3nz3krC6hwmZq+W1VdEKyGcYgRYK2WZAnPKZuSRsNZP5jXyqehFq X/lh3vk8g9BQ3iJvDToFY8/0VhjH+3kVwZOhvVgWFU9oj0xWsrf3Tm8m8kxdWfUo 432ODQdUGxE5gUEfSzoTL5GdexkV9KYfDeNavlRzMFjIbYDjZfyyP5Cd4hnxKtKk 4ojJNjFC5rfAokQLA8vzSKg5DUnI0MMOCvfgSZnkaMTdsl9+o6uHcGdDj5XdU9Bs uq11OhR6P9ecWWstFIjgbYSPR3bLS0uNnvZw5sqEDGFJbpzyajTkCWTjTAQDnGNv dCic9XbSLhVVi44w0bDaoXnWumCKYqveO2i4vsPQDV00IInMBcUfToZTQVNaAu8+ uz/I21Ggekc2VEl/AlqeTfJWnFuuI8Mjb6L/KW8Leoxwq7H9T4tOtSa+MYsmEsye 8D0RSroEcXzmS88lEmX9MgV4SH2J0AJcy6mwe9hmPQmheEVQn0B450tJNAg7Q6/E sv+Jrd+80Txpb3if49nd =syrC -----END PGP SIGNATURE----- From beat.arnet at gmail.com Tue Jul 29 18:37:59 2008 From: beat.arnet at gmail.com (Beat Arnet) Date: Tue, 29 Jul 2008 20:37:59 -0400 Subject: [Rxtx] Towards an RXTX release In-Reply-To: <20980-23424@sneakemail.com> References: <460801A4097E3D4CA04CC64EE648584806C56CF0@ism-mail03.corp.ad.wrs.com> <13557-75390@sneakemail.com> <20980-23424@sneakemail.com> Message-ID: <488FB7E7.8000802@gmail.com> All, Is there any chance that the next official release could improve on the port scanning (getPortIdentifiers)? The current method of timed-out reads can be extremely slow, in the presence of bluetooth "COM" ports. http://mailman.qbang.org/pipermail/rxtx/2004-May/1391561.html Thanks! Beat Arnet iqzw2r602 at sneakemail.com wrote: > Sorry, my name's Uwe, I posted here before :) - I don't wanna be > anonymous, just like to prevent spam where possible ;) > > I could only test it so far on Win32, but I'll get a Mac soon to test > it on there - for the other platforms I'd have to rely on someone in > the rxtx community to test the functionality. > > I'll send you a patch as soon as I have it tested on Mac OSX. It'd be > really cool to integrate it into an official version; having a > separate branch of rxtx for that sucks ;) > > Cheers, > > Uwe > > > On Thu, Jul 24, 2008 at 1:53 PM, Trent Jarvi tjarvi-at-qbang.org > |rxtx.org mailing list| > <... > wrote: > > > Hi iqzw2r602 :) > > The idea sounds OK. We can probably look at that after we are > sure the basic functionality satisfies everyone. > > > On Thu, 24 Jul 2008, iqzw2r602 at sneakemail.com > wrote: > > Awesome, I'm actually eagerly waiting for a new release. > > One thing I'd definitely like to have in there: > WebStart support out of the box. > > My application uses webstart, and I found it quite tedious to > make rxtx > webstartable. You have to jump through a couple of hoops to > make that > happen, especially if you don't know your way around with > these things. I > think bluecove (JSR-82 [Bluetooth] implementation for J2SE - > www.bluecove.org ) sets a good > example how Java libraries can handle the > native library bundling problem: All is packed into a single > JAR file, so > all I do in netbeans to make my application run from a JNLP > file is to tick > the 'webstart' box, and that's it. No JNLP file editing, no > native library > fiddling, it just works. > > For RXTX, I think it'd be best to offer two versions: The > rxtx.jar (no > native libraries packed) that we already have in the current > version, with > separate native libraries, and a new rxtx-ws.jar that has all > native > libraries embedded within it. > > I modified rxtx locally to make it webstartable out of the box > - so I > created the rxtx-ws.jar that I'm talking about above already. > I'd be very > happy to contribute that code. The modifications are minimal, > all I did was > to add a NativeLibLoader class, replace all calls to > System.loadLibrary() > with NativeLibLoader.loadLibrary() and packaging the native > libraries into > rxtx's JAR file. > > What do you think? > > > On Thu, Jul 24, 2008 at 12:00 AM, Oberhuber, Martin > Martin.Oberhuber-at-windriver.com > |rxtx.org > mailing list| < > ...> wrote: > > Hi all, > > my company is working towards a commercial product in > which we'd like to > pick > up RXTX plus fixes that have been made since the latest > release (2.1-7r2). > > But, we can only pick up an officially released version of > RXTX and I > haven't been able to follow RXTX development too closely > in the past few > weeks, so I'm not totally up to date. Therefore, I would > like to ask > > - What is the current status of LATEST in branch > "commapi-0-0-1". Is it > considered stable or have there been any risky checkins? > - Are there any additional features that people would > like to get done > before cutting a release? We are particularly interested > in total stability, > and improving the situation around lockfiles (I have > e-mailed the list on > this topic before, and I could contribute patches for that). > - What process would we like to set up towards a > release. Unittests? > How many Platforms? Create a new branch? How much time > do we expect between > "code freeze" and "release". > > For our product, we need a feature-complete, compiled and > downloadable > release candidate on August 31. We need this on Windows, > Linux x86 32-bit > (Redhat RHEL 4), and Solaris 9. This will be handed off to > our testing > department. > > Is everybody OK with working towards a release by that time? > > If yes, then I guess the next step will be to determine > when we want to get > milestone builds done and how to get the build / unittest > machine set up. > > Thanks, > -- > *Martin Oberhuber*, Senior Member of Technical Staff, > *Wind River* > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080729/99603389/attachment-0020.html From tjarvi at qbang.org Tue Jul 29 20:15:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Jul 2008 20:15:38 -0600 (MDT) Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > Hi all, > > I have investigated what it would take to enhance RXTX such that > serial ports can be locked properly on Linux. > > I found that most distributions follow the Linux File System Standard, > so the current RXTX code works for them. > > But redhat (RHEL4, RHEL5) does something different: on redhat > distributions, the /var/lock directory is owned by group "lock" > which is other than the group "uucp" which owns the ports themselves. > In order to allow users to create lockfiles, they use a special > setuid program (/usr/sbin/lockdev) which is capable of creating > the locks. > > Redhat has even patched the minicom program in order to use the > lockdev program. So, if RXTX based applications are to work > "out of the box" on Redhat like other programs, it looks like > there is no way around calling lockdev. > > One drawback is that the program is not documented: See > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > which means there can be bugs, or redhat can change its > functionality without notice. > > What does the group here think, should rxtx support Redhat's > liblockdev-baudboy ? Some more URLs for reference: > > Redhat's patch to minicom > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/minicom-1.8 > 3.1-rh.patch.html > > RPMFind for lockdev-baudboy-devel > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockdev-baudboy- > devel-1.0.3-3.i586.rpm.html > > Hi Martin, I remember this library from long ago. It isn't a bad start - in fact I wouldnt mind sticking some of rxtx's code into it. I thought I had a config time option to link to it at one time but may have never submitted it. Thats not a good direction to go in my opinion. My objections are not the same as those at GNU. 1) This isn't a part of any standard. 2) While many distros have some form of the library, There does not appear to be an upstream maintainer. Distros don't have a means of pushing upstream and having the same end result. Documentation is available. http://linux.die.net/man/3/lockdev Instead, I would suggest we do an exclusive open and try to lock as is if lockfiles are not disabled. Warn if the lock fails. Always respect lockfiles prior to opening. Exclusive opens should work on linux, mac, sol, bsd, ... The code is simple and does not introduce any new dependencies. ... open ... do { res = ioctl(fd, TIOCEXCL, 0); } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); if( res != 0 ) fail In the worst case, minicom or another application may not be able to find a lockfile but their open will fail. We locked the port. Other applications may not do this so we should always respect lockfiles. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Wed Jul 30 02:05:30 2008 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Wed, 30 Jul 2008 08:05:30 +0000 Subject: [Rxtx] usb rs232 plug and play Message-ID: Hi all I write a program which can detect usb rs232 appear and disappear. I use the code in a thread. I can get new rs232 port when I plug the usb cable. CommPortIdentifier.getPortIdentifiers(); After get the new port , I use another thread which invoke CommPortIdentifier.getPortIdentifier(portName) every 5 secs. If the usb cable is disconnected. It will throw NoSuchPortException . I close the port and do not control the port until I get the port again. If the usb cable is connected. I use input/output stream to communication with my rs232 device. serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT);serialPort.setSerialPortParams(BOUD_RATE, DATA_BITS, STOP_BITS, PARITY); os = serialPort.getOutputStream();is = serialPort.getInputStream(); when the usb calble is disconnected . I close the stream , and wait the usb cable plug again. os.close(); is.close();serialPort.close(); It usually works well. But , when after many tries. it often show the error message . gnu.io.PortInUseException: Unknown Application throws when the code is executing serialPort = (SerialPort) portId.open(PORT_APP_NAME, PORT_OPENING_TIMEOUT); How should I do? _________________________________________________________________ 5 GB ???? ????????????????? ? ???? Windows Live Hotmail http://mail.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080730/18ba95ca/attachment-0020.html From Martin.Oberhuber at windriver.com Wed Jul 30 15:29:01 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 30 Jul 2008 23:29:01 +0200 Subject: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584806CF1AA4@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584806DC3ABA@ism-mail03.corp.ad.wrs.com> Ah, thanks for the code. Awsome. I wasn't aware that the Kernel-level locking is that simple. I'll try it out. With respect to liblockdev, I think you are misunderstanding: There is the original liblockdev library (the manpage of which you reference), and then on Redhat / Fedora they have "baudboy" which is a setgid exectuable around liblockdev. They use the separate setgid exe in order to allow them creating lockfiles in /var/lock belonging to group "lock", even if users are not member of that group. The latter is nonstandard redhat-only, and that's what my question was referring to since we are not currently calling the setgid executable (though we could relatively easily). I agree, though, that checking the locks (read-only) but not creating them if TIOCEXL works, looks like an even better solution. Looks like the only thing we cannot do in that case is delete a rogue lockfile from a dead process, but that's not necessarily ours to do anyways. Thanks again for the hint, Martin -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Wednesday, July 30, 2008 4:16 AM > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Port locking on Linux: Redhat lockdev-baudboy > > On Tue, 29 Jul 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I have investigated what it would take to enhance RXTX such that > > serial ports can be locked properly on Linux. > > > > I found that most distributions follow the Linux File > System Standard, > > so the current RXTX code works for them. > > > > But redhat (RHEL4, RHEL5) does something different: on redhat > > distributions, the /var/lock directory is owned by group "lock" > > which is other than the group "uucp" which owns the ports > themselves. > > In order to allow users to create lockfiles, they use a special > > setuid program (/usr/sbin/lockdev) which is capable of creating > > the locks. > > > > Redhat has even patched the minicom program in order to use the > > lockdev program. So, if RXTX based applications are to work > > "out of the box" on Redhat like other programs, it looks like > > there is no way around calling lockdev. > > > > One drawback is that the program is not documented: See > > http://osdir.com/ml/hardware.avr.avrdude.devel/2006-09/msg00004.html > > which means there can be bugs, or redhat can change its > > functionality without notice. > > > > What does the group here think, should rxtx support Redhat's > > liblockdev-baudboy ? Some more URLs for reference: > > > > Redhat's patch to minicom > > > http://www.filewatcher.com/p/minicom-2.00.0-6.src.rpm.412313/m > inicom-1.8 > > 3.1-rh.patch.html > > > > RPMFind for lockdev-baudboy-devel > > > http://rpm.pbone.net/index.php3/stat/4/idpl/6805746/com/lockde > v-baudboy- > > devel-1.0.3-3.i586.rpm.html > > > > > > Hi Martin, > > I remember this library from long ago. It isn't a bad start > - in fact I > wouldnt mind sticking some of rxtx's code into it. I thought I had a > config time option to link to it at one time but may have > never submitted > it. > > Thats not a good direction to go in my opinion. My > objections are not the > same as those at GNU. > > 1) This isn't a part of any standard. > 2) While many distros have some form of the library, There > does not appear > to be an upstream maintainer. Distros don't have a means of pushing > upstream and having the same end result. > > Documentation is available. > > http://linux.die.net/man/3/lockdev > > Instead, I would suggest we do an exclusive open and try to > lock as is if > lockfiles are not disabled. Warn if the lock fails. Always respect > lockfiles prior to opening. > > Exclusive opens should work on linux, mac, sol, bsd, ... > > The code is simple and does not introduce any new dependencies. > > ... > open > ... > do { > res = ioctl(fd, TIOCEXCL, 0); > } while ( (errno == EINTR || errno == EAGAIN ) && res != 0 ); > > > if( res != 0 ) > fail > > > In the worst case, minicom or another application may not be > able to find > a lockfile but their open will fail. We locked the port. Other > applications may not do this so we should always respect lockfiles. > > -- > Trent Jarvi > tjarvi at qbang.org > From david.goddet at gmail.com Tue Jul 1 01:57:33 2008 From: david.goddet at gmail.com (David Arnaud-Goddet) Date: Tue, 1 Jul 2008 09:57:33 +0200 Subject: [Rxtx] Problem to use rfcomm Message-ID: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Hi all, I try to communicate with bluetooth devices (biomedical captor) which send their data by virtual serial port. Under Linux my devices are well detected and I receive data when I do : >rfcomm connect 0 // My device is bind on rfcomm0 >cat /dev/rfcomm0 // I receive here the data But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort exception is thrown. Is it possible to detecte rfcomm with RXTX? I already use the library with an USB GPS receptor without problem (which used ttyUSB0). I use a fonction to list all serial port and the /dev/rfcomm0 isn't detected. Here is a piece of my code : import gnu.io.*; public boolean SearchDefautPort() { boolean portFound = false; //On cherche le port par defaut. Si on le trouve on initialise le reader portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Port serie : " + portId.getName()); if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //nulltest reader = new nulltest(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } return portFound; } Have anybody already used RXTX library with rfcomm? Thanks in advance. -- David ARNAUD-GODDET -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/97c27d7f/attachment-0050.html From Sylvain.Decastel at hefr.ch Tue Jul 1 03:38:38 2008 From: Sylvain.Decastel at hefr.ch (=?iso-8859-1?Q?D=E9castel_Sylvain?=) Date: Tue, 1 Jul 2008 11:38:38 +0200 Subject: [Rxtx] Bad char received Message-ID: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Hello, I'm using rx-tx library to communicate with a DSP card, for now it works very well ! Thanks to all developers! But I have a big problem today !!! I've already seach on the web but didn't find anything about it ! Some chars, 0x80 or 0x81, sent to the PC are not correctly read. The read result is 0x20AC or 0x2223 ! I have no problem with all the alphabetic/numeric chars, and the control chars that I use STX, ETX, and DLE (0x02, 0x03, 0x10) too. To read the char my class implements serialEventPortListener and the serialEvent method is use to detect when a new char is received. The input stream is created with : inputStream = serialPort.getInputStream(); inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); And the received char is read with : char result[] = new char[1]; inputStreamReader.read(result); I'm using Netbeans to edit/compile java code and the rxrx-2.1-7 r2. Thanks Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080701/7be9f715/attachment-0050.html From lyon at docjava.com Tue Jul 1 04:35:58 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 01 Jul 2008 06:35:58 -0400 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: Hi All, Is there a limit to the speed at which RXTX can toggle DTR? I have been trying to use this as a control signal, but find that the rate at which I can toggle DTR is quite limited. I am not sure what the limiting factor is. Thanks! - Doug P.S. I am on a Mac using a USB to Serial dongle. From michael.erskine at ketech.com Tue Jul 1 04:40:43 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Tue, 1 Jul 2008 11:40:43 +0100 Subject: [Rxtx] Bad char received In-Reply-To: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> References: <70DD3A1408BDA8498790E8D553B7D25394D094E4F4@HEFRMAIL.sofr.hefr.lan> Message-ID: <06BA3262D918014F9183B66425D5A8D431C1290882@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > D?castel Sylvain > Sent: 01 July 2008 10:39 > Subject: [Rxtx] Bad char received Some ground-rules to remember... In Java the char primitive is a 16-bit unsigned integer and a byte is an 8-bit signed integer. When 0x80 or 0x81 is sent it must be sent as an unsigned byte. When you move from the world of InputStream to Reader and its implementations you are subject to locale translation of bytes to characters. In short, don't do it! Read bytes from the InputStream, remember that they're signed in Java and process appropriately. Regards, Michael Erskine. From mringwal at inf.ethz.ch Tue Jul 1 04:57:27 2008 From: mringwal at inf.ethz.ch (Matthias Ringwald) Date: Tue, 1 Jul 2008 12:57:27 +0200 Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: hi doug just my unprofessional opinion: I would assume that the USB-subsystem is the limiting factor when using a USB-2-Serial dongle. For each toggle, a USB command has to be sent over the bus in a separate package. In this very same package, you might put some real data, e.g., 100 bytes in there (I'm not familiar with actual USB spec). With this guess, toggling the DTR will be 1000x slower than the maximal data rate. If the dongle can do 1 MBps, this might give you 1000 bps. how fast can you togge? cheers, matthias On 01.07.2008, at 12:35, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Jul 1 18:59:25 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 18:59:25 -0600 (MDT) Subject: [Rxtx] Problem to use rfcomm In-Reply-To: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> References: <10c19b820807010057j79ee8ea3sf827be29ad48d57c@mail.gmail.com> Message-ID: On Tue, 1 Jul 2008, David Arnaud-Goddet wrote: > Hi all, > > I try to communicate with bluetooth devices (biomedical captor) which send > their data by virtual serial port. > Under Linux my devices are well detected and I receive data when I do : >> rfcomm connect 0 // My device is bind on rfcomm0 >> cat /dev/rfcomm0 // I receive here the data > > But when I try to open the /dev/rfcomm0 port in my java code, a NoSuchPort > exception is thrown. > Is it possible to detecte rfcomm with RXTX? I already use the library with > an USB GPS receptor without problem (which used ttyUSB0). > > I use a fonction to list all serial port and the /dev/rfcomm0 isn't > detected. Here is a piece of my code : > > import gnu.io.*; > > public boolean SearchDefautPort() > { > boolean portFound = false; > > //On cherche le port par defaut. Si on le trouve on initialise le > reader > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) > { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) > { > System.out.println("Port serie : " + portId.getName()); > if (portId.getName().equals(defaultPort)) > { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //nulltest reader = new nulltest(); > } > } > } > if (!portFound) > { > System.out.println("port " + defaultPort + " not found."); > } > return portFound; > } > > Have anybody already used RXTX library with rfcomm? > Thanks in advance. > > > > Hi David, Try starting your program like this: java -Dgnu.io.rxtx.SerialPorts=/dev/rfcomm0 MyClass http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jul 1 19:10:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 Jul 2008 19:10:02 -0600 (MDT) Subject: [Rxtx] dtr speed limits In-Reply-To: References: Message-ID: On Tue, 1 Jul 2008, Dr. Douglas Lyon wrote: > Hi All, > Is there a limit to the speed at which RXTX can > toggle DTR? > > I have been trying to use this as a control signal, but find > that the rate at which I can toggle DTR is quite limited. > > I am not sure what the limiting factor is. > > Thanks! > - Doug > > P.S. I am on a Mac using a USB to Serial dongle. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Hi Doug, I'd assume that DTR could toggle at about 10 ms/trigger with a real serial port. It is close enough that people often want to try RS485 in software with but not good enough to actually do it. I recall someone put a patche into the Linux kernel serial driver to get the last mile in the past. The patches never made it into the mainstream kernel though. The post is probably in the LKML archives. It would be interesting to try with a scope on DTR to see for sure... -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Wed Jul 2 02:48:58 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Wed, 02 Jul 2008 10:48:58 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <4860BA3D.3010609@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> Message-ID: <486B40FA.1030502@tatexpress.fr> Hi all, I try with 2 other thermal printer (UBI91 & Eltron Orion : 9600/N/8/1/XonXoff) I'm getting the same result: ->No Xon/Xoff char on Port COM (C++ & Python) ->Exists Xon/Xoff char on Port COM (Java) Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? If no, do I something wrong (java test in my precedent email)? If yes, do I manage it by myself? Thanks in advance Best regards Cyrille. Cyrille DUMONT a ?crit : > Hi, > > OS: Windows XP > Rxtx: v2.1 > > Java: > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); > SerialPort sPort = (SerialPort)portId.open("TEST", 30000); > //-- 9600/N/8/1/XonXoff > sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | > SerialPort.FLOWCONTROL_XONXOFF_OUT); > OutputStream os = sPort.getOutputStream(); > InputStream is = sPort.getInputStream(); > > //-- Send N data to the Printer > os.write(sDataOut.getBytes()); > .... > > //-- Read printing result > StringBuffer inputBuffer = new StringBuffer(); > do { > for (int newData = is.read(); newData != -1; newData = is.read()) { > inputBuffer.append((char) newData); > } > try {Thread.sleep(250);} catch (InterruptedException ex) {} > } while (inputBuffer.length() <= 0); > sDataIn = inputBuffer.toString(); > > // => sDataIn: "#13#15#31#30#32#32" (Xoff) > > > C++: > A little difficult to get code (not an application of mine). I only know > what is written and what is receaved (no Xon/Xoff char) > > Python (use library "pyserial" ; same result as C++): > #-- 9600/N/8/1/XonXoff > mySerial = serial.Serial( \ > port = 0, \ > baudrate = 9600, \ > bytesize = 8, \ > parity = 'N', \ > stopbits = 1, \ > timeout = 20, \ > xonxoff = 1, \ > rtscts = 0) > bPortOpen = mySerial.isOpen() > > #-- Send N data to the Printer > mySerial.write(sDataOut) > ... > > #-- Read printing result > sDataIn = mySerial.read(10) > > #--> sDataIn: "#15#31#30#32#32" (no Xoff) > > Thanks in advance > Best regards. > > Cyrille. > > > Trent Jarvi a ?crit : > >> On Mon, 23 Jun 2008, Cyrille DUMONT wrote: >> >> >>> Hi All, >>> >>> I'm using, for a project, a thermal printer (UBI501 : >>> 9600/N/8/1/XonXoff) in order to print stickers. >>> When I print a sticker, the printing result is available on the com >>> port. >>> >>> When I use C++ to read on the com port, I've, for ex., >>> "#15#31#30#32#32" >>> but when I use Java(via rxtx : the same param, as the UBI501, is used), >>> I've "#13#15#31#30#32#32" >>> (# : hexa) >>> >>> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >>> printing result. >>> Is it normal to find XON/XOFF characters on the Inputstream, even if >>> XonXoff flow ctrl is activated? >>> (I never find them with C++) >>> A way to deal with them ? >>> >>> Thanks in advance. >>> Best regards >>> >>> Cyrille. >>> >>> >> Hi Crylle: >> >> Sounds like we are doing something wrong. >> >> What OS are you using? >> What is the java code in a simple test case? >> What is the corresponding C++ code? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Jul 3 21:55:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Jul 2008 21:55:36 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <486B40FA.1030502@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> <4860BA3D.3010609@tatexpress.fr> <486B40FA.1030502@tatexpress.fr> Message-ID: Hi Cryille This really looks like a bug in rxtx for win32 but I need to sit down with two computers and two applications to figure out for sure. In your original code, I saw you used some | logic to set both input and output to Xon. In reality rxtx does not allow fine grained control as such. Either a flow control is on or off. You might try just setting one to make sure there isn't a flaw in how we handle both. Otherwise, this is probably an issue in termios.c that needs to be flushed out. I would recommend creating a bugzilla entry for this with reproduction steps that don't involve your hardware idealy. I'm interested in finding the solution but that is probably a couple weeks away. Other pieces of the next release are being put together right now (build env). On Wed, 2 Jul 2008, Cyrille DUMONT wrote: > Hi all, > I try with 2 other thermal printer (UBI91 & Eltron Orion : > 9600/N/8/1/XonXoff) > I'm getting the same result: > ->No Xon/Xoff char on Port COM (C++ & Python) > ->Exists Xon/Xoff char on Port COM (Java) > > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > > If no, do I something wrong (java test in my precedent email)? > If yes, do I manage it by myself? > > > Thanks in advance > > Best regards > > Cyrille. > > > > Cyrille DUMONT a ?crit : >> Hi, >> >> OS: Windows XP >> Rxtx: v2.1 >> >> Java: >> CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); >> SerialPort sPort = (SerialPort)portId.open("TEST", 30000); >> //-- 9600/N/8/1/XonXoff >> sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | >> SerialPort.FLOWCONTROL_XONXOFF_OUT); >> OutputStream os = sPort.getOutputStream(); >> InputStream is = sPort.getInputStream(); >> >> //-- Send N data to the Printer >> os.write(sDataOut.getBytes()); >> .... >> >> //-- Read printing result >> StringBuffer inputBuffer = new StringBuffer(); >> do { >> for (int newData = is.read(); newData != -1; newData = is.read()) { >> inputBuffer.append((char) newData); >> } >> try {Thread.sleep(250);} catch (InterruptedException ex) {} >> } while (inputBuffer.length() <= 0); >> sDataIn = inputBuffer.toString(); >> >> // => sDataIn: "#13#15#31#30#32#32" (Xoff) >> >> >> C++: >> A little